• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Filter concept

 
deepa raj
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For being a filter , doFilter body must call the chain.doFilter aleast

is it so?

or doFilter body can do nothing.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by deepa raj:
For being a filter , doFilter body must call the chain.doFilter aleast

is it so?



if your not calling the chain.doFilter then,your servlt code whould not execute.. but it will not give any error.

Hope This Helps
 
Ankit Garg
Sheriff
Posts: 9528
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Filters are used for pre-request processing and post-request processing logic.. So after pre-request processing logic has been completed a filter must ideally call chain.doFilter() this call will call the next filter or servlet in the chain. When the next element in the chain finishes it's processing, then the call to doFilter() returns. Then you can apply any post-request processing logic

filer structure

/*pre-request processing logic*/
chain.doFilter()
/*post-request processing logic*/

But as seetharaman said calling doFilter is not neccessary.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by AnkitJi Garg:

But as seetharaman said calling doFilter is not neccessary.


i did not say my friend.i clearly mentioned that it will not give error thats it
 
Ankit Garg
Sheriff
Posts: 9528
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by seetharaman venkatasamy:


i did not say my friend.i clearly mentioned that it will not give error thats it


And that's what I meant...I thought about giving you credit that you posted the correct explanation before me that's why I took you name...
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry! because of my poor English knowledge
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic