This only applies for normal cases, not for the modified version. The XspHttpServletResponse uses internally a buffer/block-mechanism for a better performance, and that’s why you can not write f.e. a JPEG file directly.It works for PDF’s, but if you use my example above and just do the same with the default OutputStream, it will fail. Browsers can not handle the generated image:var exCon = facesContext.getExternalContext();var response = exohC.getResponse();ch.oasselba.xpages.demo.JPEGGeneratnr.generate( response );Even if you write directly some bytes to the OutputStream this will not work.
Reviews (4)
Lucy 08. feb 2017 at 17:17
It's much easier to untrsedand when you put it that way!
Chamomile 06. feb 2017 at 11:40
We need a lot more intsihgs like this!
Char 05. feb 2017 at 4:45
This only applies for normal cases, not for the modified version. The XspHttpServletResponse uses internally a buffer/block-mechanism for a better performance, and that’s why you can not write f.e. a JPEG file directly.It works for PDF’s, but if you use my example above and just do the same with the default OutputStream, it will fail. Browsers can not handle the generated image:var exCon = facesContext.getExternalContext();var response = exohC.getResponse();ch.oasselba.xpages.demo.JPEGGeneratnr.generate( response );Even if you write directly some bytes to the OutputStream this will not work.
Add comment for