*
The moose likes Struts and the fly likes Customizing Menu Bar base on Security Role Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Customizing Menu Bar base on Security Role" Watch "Customizing Menu Bar base on Security Role" New topic
Author

Customizing Menu Bar base on Security Role

Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 569
In tiles taglib, I can see the role= attribute for customizing view base on user's role. I am wondering if this attribute is also available in other struts taglib like <html:link>. I want to have a list of links to be optionally displayed only when the user is logged in as certain role.

What else could I use to achieve this result. Would there be any ready made taglib supporting this?
Ergin Er
Ranch Hand

Joined: Sep 06, 2005
Posts: 60
I don't know if you can use the roles in the tags. That would be very nice if it could.

But other way to achieve what you want is using some flag attributes in the code (if a certain user logs on set this flag to a value and compare in your view on that flag), or using <logic:equals> on the current user attribute that contains users role (if the user is put in the session).
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

It wouldn't be very difficult to implement this by creating your own taglib or extending Struts tags. It may seem intimidating now but once you get started you'll be fine.


A good workman is known by his tools.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Customizing Menu Bar base on Security Role
 
Similar Threads
Doubt on taglib?
"taglib" and "uri" attributes of taglib directive
What is better way for the role managment in J2EE ?
Controlling a taglib base on Security Role
Final Mock Test Question 49,69, Head First and Servlets