Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting the list of roles defined in web.xml  RSS feed

 
Junilu Lacar
Sheriff
Posts: 10879
158
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!