wood burning stoves 2.0*
The moose likes Struts and the fly likes Struts application with user permission & role Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts application with user permission & role" Watch "Struts application with user permission & role" New topic

Struts application with user permission & role

Rajagopal Mani
Ranch Hand

Joined: Mar 24, 2011
Posts: 84


I need to access user info(permisson & role) in all the JSP pages so that certain operations(buttons/Link/Info) can be restricted based on the user. I am using framework struts1.2. Below are some of the option.

[1] Using Session
[2] Passing user info thru form-bean(but i am not able to get this in child window)
[3] Setting request in action & access in corresponding JSP(but need to get user details & set in request scope in all the action class. Looks redundant)

I would like to know the effective design to achieve this. Any suggestions would be highly appreciate.

vipul bondugula
Ranch Hand

Joined: Oct 14, 2010
Posts: 218
In struts-config.xml file you can specify the roles. Every request is interpreted by RequestProcessor class. In the RequestProcessor class you will have processRoles() that takes request,response,ActionMapping as arguments. You can override this method to check the roles and permissions.


Vipul Kumar
Joe Ess

Joined: Oct 29, 2001
Posts: 8836

Have a look at the JEE tutorial. It has a chapter on Security in the Java EE Platform.

"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Struts application with user permission & role
Similar Threads
Tag Library and Struts Framework
JSTL vs DOM generated HTML Table
security-constraint not working
Jsp or Servlet
"STRUTS-like action"