Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

question about tomcat JDBC realm.

 
raminaa niilian
Ranch Hand
Posts: 551
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Thank you for reading my post.
i have some question about jdbc realm in tomcat.
-can we have several realms ?
-how an application knows which realm to use?
-i add a new realm to tomcat but i could not enter the admin console anymore until i reinstall the tomcat and admin console.
-each user in my system has one role , can i use just one table for authentication ?
I mean i add a role_name column to users table and map its column in server.xml?
thanks
[ September 09, 2006: Message edited by: raminaa niilian ]
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

-can we have several realms ?

Tomcat supports a single realm per web application. Different web apps can have different realms.

-how an application knows which realm to use?

That is configured with the <Realm> element in conf/server.xml, or the <Context> element for individual web apps. Check the Tomcat Realm documentation for details.

-i add a new realm to tomcat but i could not enter the admin console anymore until i reinstall the tomcat and admin console.

Could it be that the realm you configured does not include the username/password used for the Admin console?

-each user in my system has one role , can i use just one table for authentication ? I mean i add a role_name column to users table and map its column in server.xml?
I don't think so. The JDBC realm documentation says that three tables are required: users, roles, and user roles.
[ September 09, 2006: Message edited by: Ulf Dittmer ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic