I’m understand that
<security-role><role-name>Admin</role-name></security-role>
is for container map it with tomcat-users.xml (realm)
but I confuse about if I didn’t use realm but I use database how container know which field in my database is for role-name or it have naming convention in database field name like “role_name” and container will know it
Thank you for every advices
Just use a database realm and configure the table and column names in a
<Realm>element in server configuration file. For Tomcat, this is described in the Realm HOWTO. Here’s an extract of relevance, from the JDBCRealm chapter:Pretty clear, isn’t it? If you already have a JDBC datasource configured in Tomcat (for connection pooling and on), then you can also use DataSourceRealm instead.
The
tomcat-users.xmlwhich you’re talking about is by the way called UserDatabaseRealm.