File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Filter doubt

 
philip johnson
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64205
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happened when you tried it?
 
Angel J Gama
Ranch Hand
Posts: 36
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
philip johnson
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic