After my servlet is run, JBoss returns an inconsistent and usually bad http
response mime type to the browser. Mostly it becomes "application/octet-stream"
instead of "application/pdf" which I explicitly set. But not always... This is
the output part:
| ServletOutputStream out = res.getOutputStream();
| res.setContentType("application/pdf");
| res.setContentLength((int)outfile.length());
| bis = new BufferedInputStream(new FileInputStream(outfile));
| bos = new BufferedOutputStream(out);
| byte[] buff = new byte[2048];
| int bytesRead;
| while(-1 != (bytesRead = bis.read(buff, 0, buff.length)))
| {
| bos.write(buff, 0, bytesRead);
| }
| bos.flush();
| bos.close();
|
It used to work all the time in standalone Tomcat 5.5. The server-wide web.xml
contains the pdf mime type. I don't understand this issue.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4030155#4030155
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4030155
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user