Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 2 - Servelts and authorisation

 
Craig Burrows
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I am new to struts 2, I have a few simple queries whose solution can't seem to be found using a search engine.

1. Servlets
Are servlets usefull at all when implementing struts 2? It seems that everything can be performed with action classes and interceptors, so I assume a project implementing struts 2 would never use servlets (or filters)?

2. User authorisation.
With struts 2 is it standard practice to use j_security when implementing secure pages, or to use a custom made authorisation interceptor? (Assuming you are using no other framework for security).


 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) It'd be rare to use a servlet, but I'd never say never. For example, if a company had an old image-serving servlet laying around they might use that instead of turning it into an action. Filters are a different matter; IMO they'd be more likely to be used regardless of framework than a servlet.

2) There's no "standard practice" when it comes to choosing which security to use--it depends entirely upon the environment, preferences, etc. Because of Struts 2's tight Spring integration Spring Security (Acegi) is always a popular choice. Container-managed security is also used a lot. So are custom solutions.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic