Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

doFilter must invoke chain.doFilter()?  RSS feed

 
sudheer kiran
Ranch Hand
Posts: 237
Firefox Browser MyEclipse IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in HFSJ one tiome they doFilter() must invoke chain.doFilter() method and i remember some where in that text they say
its not a need.

please calirify my doubt
doFilter() must invoke chain.doFilter() ot not.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The javadocs of the doFilter method answer this question.
 
Rob Spoor
Sheriff
Posts: 20941
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Usually it does call chain.doFilter, but it's not required to do so. If the filter (e.g. one that checks for user logins) determines that the regular filter flow should not be followed but the request should be redirected (e.g. to some login page) than it should skip the chain.doFilter call.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!