• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Security with user data from db

 
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello,

i am reading head first Servlet & Jsp right now and have finished the chapter on security ...

now, it says that the users and roles are declared in the tomcat-users.xml which is somewhat cumbersome and awkward since in real development you would use a database to store user relevant information.

The thing that i need to know, how do you tell the container to retrieve the user and roles data from a database rather than from the xml file?

thanks for your help

 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just make use of container managed realm.

In case of Tomcat you may find this document useful: http://tomcat.apache.org/tomcat-6.0-doc/realm-howto.html
 
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sebastian Janisch wrote:

now, it says that the users and roles are declared in the tomcat-users.xml which is somewhat cumbersome and awkward since in real development you would use a database to store user relevant information.



I too don't know much about tomcat-users.xml , but surely he is not talking about the DB user names and passwords. This XML file typically refers to the login information related to the server.

Google on to tomcat-users.xml
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, tomcat-users.xml only applies to the admin/management console of Tomcat server. It has nothing to do with authentication of the running webapplications.
reply
    Bookmark Topic Watch Topic
  • New Topic