Hi In my filter if I get res.getOutputStream(); and I modify it and then flush it, what will happen to the next filter part of same app accessing the same outputstream and trying to modify , since it closed , will it throw illegalStateException, or the webcontainer keep the stream open till all the filters finished.
Once you commit the response, there is no other thing to commit later. And when you've commited the response, it'll be sent back to the client. But if you commit the response and then you try to do something with it, then you'll get the IlegalStateException. If you stop the chain -no call to chain.doFilter()- no other filters are executed, and that makes sense because the chain object knows what resource is in stack (filter, servlet, ...) [ August 31, 2008: Message edited by: Angel J Gama ]
Joined: Dec 25, 2007
HI Why I asked I am using third party jars for couple of filters, they are writing to the ServletOutputStream and flushinh it, in two filters it is happening, when you chain it I could not predict the behaviour, sometime it work, sometime it crashed with the outputsteram is already obtained exception. SO my questionis what is the standard way to chain filters, how you change the source if you want to modify the jars.I think the filter provider think you are usingonly this filter. Thanks.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com