Click to See Complete Forum and Search --> : write file into response for jsp display


amarsibia
10-08-2009, 09:54 AM
I'm looking to embed a swf file into a jsp, the swf is actually created server side and so im totally at a loss as to how to put the file in the response so that the jsp will be able to access the swf and render it.

I know how to pass the file so the user can download it;


response.setContentType("application/ppt");
response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\"");
response.setHeader("cache-control", "no-cache");
OutputStream out = response.getOutputStream();
out.write(file);


I think it might be a method so the page can render it. Any help would be really useful.

Khalid Ali
10-24-2009, 08:44 AM
I'm looking to embed a swf file into a jsp, the swf is actually created server side and so im totally at a loss as to how to put the file in the response so that the jsp will be able to access the swf and render it.

I know how to pass the file so the user can download it;


response.setContentType("application/ppt");
response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\"");
response.setHeader("cache-control", "no-cache");
OutputStream out = response.getOutputStream();
out.write(file);



I think it might be a method so the page can render it. Any help would be really useful.

Mske following changes and then try

your content type seem to be incorrect. for flash files
content-type=application//x-shockwave-flash

and if not, then make sure you are closing all handles like
out.close();
etc