aspose file tools*
The moose likes Security and the fly likes Getting the list of roles defined in web.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » Security
Bookmark "Getting the list of roles defined in web.xml" Watch "Getting the list of roles defined in web.xml" New topic
Author

Getting the list of roles defined in web.xml

Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4419
    
    5

Apart from reading and parsing the web.xml, is there a way to get the list of roles defined under the <auth-constraint> element in web.xml?
I want to avoid hard-coding role names in my application. If I could get the list and iterate over it, I can write my additional role-based checking/processing code just once, keeping all the variables as properties in an application config file. I could put the list of roles in the application config file as well but that would mean that we would have to remember to change both web.xml and appconfig.properties when a new role is created (yeah, I know about comments but there's no guarantee that everyone reads them).
I've waded through the JavaDocs and Googled but found no joy and would appreciate if someone could point me in the right direction, even if it's to say that I'm way out in left field on this.
TIA


Junilu - [How to Ask Questions] [How to Answer Questions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting the list of roles defined in web.xml
 
Similar Threads
Getting defined security-roles programatically
Question on web-app security
Using weblogic security roles in authentication: weblogic 9
HTTP Status 403 Access to the requested resource has been denied
Using weblogic security roles in authentication: weblogic 9