• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Declarative security in struts2

 
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using struts2, and I want to restrict access to certain pages for certain users, I want to use declarative security like servlets
But how do I use declarative security for struts2 action classes, because the problem is in <http-method> element from <web-resource-collection> element. Can I mention Action class's execute method, like I used POST, GET methods for restricting access to url's mentioned in <url-pattern> with respect to those methods in conjuction with user roles?

I had read somewhere that, you have to make up your mind to either use servlets or struts action classes. So if I wanted to use struts2, then how to use declarative security?

Can anybody please guide me? I am stuck on this problem.
 
Ranch Hand
Posts: 122
Mac IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure what you mean but security doesnt really change much just because you are using struts2. My suggestion would be to put the restricted pages in a different namespace ... which would be defined in a struts.xml that is included in your configuration. Doing so will allow you to define roles that match the url-pattern which will be allowed to access that resource just like a servlet would.

I think I understand what you are saying by adding the http-method from your action class but that has nothing to do with the HTTP request. The HTTP request and the action that gets executed once the request is received are completely different. You might want to take a look at some references to see how an http request gets served on a server.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic