This week's giveaway is in the Spring forum.
We're giving away four copies of Microservices Testing (Live Project) and have Chris Love & Andres Sacco on-line!
See this thread for details.
Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

how to populate roles in Roles Interceptor in Strust2

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi All,

Regarding the Roles interceptor in Strust2, I have found only the below section from everywhere.

In struts-default.xml, we can find the below definition of Roles Interceptor.



Now, in the struts.xml of our application, we can mention the below code section in order to work with Roles interceptor.



Could you please tell me if it is the proper way to check if the user's role is the allowed one for some action.

Also, I couldn't find any method or something like that to populate user's role for Roles interceptor.

Can anyone let me know a complete example for Roles interceptor in Struts2 (specially how to populate roles in this interceptor which will be checked later with the help of request.isUserInRole(...) method).
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Looks like you posted in the Swing forum by mistake. I will move this tread over to the Struts forum for you
 
Subhrangshu Samanta
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Many thanks Maneesh....

 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How you configure user roles in a JEE container depends on the container. For example, here is how to configure Tomcat.
 
reply
    Bookmark Topic Watch Topic
  • New Topic