Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Q:Filters  RSS feed

 
Henrik Krievs
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HF says that if you don't use wrapped request/response objects - you would have a problem writing to the reponsestream AFTER chain.doFilter.

I've made a little ex. - and it works fine for me - without using the wrapped objects. What did I miss here ??

Rgds, Henrik
 
Roger Yates
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did it say would? or could?

I suspect they meant something like the following:
Since it is a chain of filters, one of those filters may decide not to forward the request any further. In this case if the request was not forwarded by a filter further down the line, your code after chain.doFilter would never get executed.

HTH
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!