This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt regarding Filters

 
Bk Jacky
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Source:JavaBeat


Which of the following are true about Filters?
a. A filter can also be configured to be invoked when a call is made to
RequestDispatcher.forward().
b. By default, a filter will be invoked only for incoming requests, however the default
can be overridden in the Deployment Descriptor.
c. All the above.
d. None of the above.

What is your choice?
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
a and b is correct
 
Bk Jacky
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you please explain me for OPTION b?
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

if you declare fillter mapping in DD..then by default(request) fillter will call before your servlet..but not for response
 
Srinu Nanduri
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A filter can also be declared for requests through forward and include too, not just for incoming requests to the web application. Hence, a and be are right according to me.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic