• Post Reply Bookmark Topic Watch Topic
  • New Topic

Filters in servlet 2.3  RSS feed

 
Roger Nelson
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Filters in servlet api 2.3 performs pre-processing or post-processing task prior or after the associated servlet is invoked.
so the filter is positioned between the client and the servlet. If its a post-procesing filter( for eg XSL formatting etc ), it also gets invoked prior to the servlet invocation but does nothing since the code in doFilter method is just meant for tweaking the output.
Does this mean that the programmer should take care that the doFilter method code should not cause any issue while the filter acts on the incoming request ?
And doesnt this cause unnecessary filter invocation during incoming request while its only needed during outcoming response. Doesnt this cause a performance issue?
If this is how it works and i understand correctly, then there are two issues,
1) coder has to take precaution in the doFilter method.
2) performance issues due to unnecessary invocation of filter.
And if a filter is meant only for pre-processing or post-processing, why doesnt the deployment descriptor give an indicator so that the container can take care of the rest and avoid the above drawbacks.
Let me know if anyone have come across this or my interpretation is incorrect.
 
Sam Cala
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmm, Good question Roger, I'm now also waiting to see someone's response here.
[ May 03, 2002: Message edited by: Sam Cala ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!