• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is the motivation to use filters in a struts application

 
Sudarshan Sreenivasan
Ranch Hand
Posts: 188
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am new to struts & from my limited understanding i guess that all my requests would pass through the action servlet(Controller) in the case all my authentication code can be placed here .

Assuming my motivation to create a filter is to implement security , cannot my action servlet just do that job ?

Thanks in advance
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34965
378
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An action servlet can do it. So can a filter or a request dispatcher. note that a filter can be reused if you have more than one servlet or application.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic