posted 10 years ago
Hi, I was wondering if someone might have some insight on a little problem I am having with a Filter I wrote for pretty printing jsp documents[jspx extension]. It seems to be the consensus that you can't make it pretty print by default so I used a response wrapper and replaced the ServletOutputStream with a ByteArrayOutputStream using a rather hack delegate following the compression example in the Head First Servlets and JSP book. It only sort of works though. Most of the tiles run all the way through and output to the ByteArrayOutputStream fine except the last one. The problem is that when the last one fails I end up with incomplete XHTML thus I can't treat it as XML and output it as a pretty printed document. It's not like its critical but I can find nothing unusual looking at the JSPX that would cause the output stream to be truncated in this way and I am not getting an error that would indicate what the problem is. Just wondering if anyone has any ideas on it. By the way, when I use the response object straight up(no wrapped objected or delegate) the page renders completely and correctly. If there is another forum more appropriate for this question please let me know.