• Post Reply Bookmark Topic Watch Topic
  • New Topic

Doubts in servlet filters.  RSS feed

 
sriram sundararajan
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all
am using the servlet filter for the first time. I
have got some doubt in its usage.
What is the use of
chain.doFilter(request, response);
inside the doFilter method. If am commenting out that
line my servlet is not working and it also does not
throw any exception in the console.
When will the filter init() and filter destroy()
method calls. My sample program does not calls the
above methods.
 
Ravi Kumar Ravuru
Ranch Hand
Posts: 176
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Sriram,
Please follow the link given below.
http://www.javaworld.com/javaworld/jw-06-2001/jw-0622-filters.html
Hope it helps.
Ravi
 
Pearlo Muthukumaran
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
filters are like layers sitting between
client and the actual servlet.
it is used for performing some actions
on the request from client and response to the
client.
you can use it for logging xml transformations
stuff like that.
number of layers i said earlier is equivalent to number of filters.
it can either act on request or response or both.
normally n number of filters can be mapped to one or more servlets.and this is configured in config file
rgds
muthu
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!