Security domain features are Tomcat built-in functions, declare a method of integrating a set of usernames, passwords, and associated characters into TOCMAT in an org.apache.catalina.realm interface.
Memory Domain: MemoryRealm reads secure authentication information from the XML file and stores in memory. JDBC Domain: JDBCREALM Access information stored in the database via JDBC drivers. Data Source Domain: DataSourceRealm Access information stored in the database via JDBC data sources. JNDI Domain: JNDIREALM Access security verification information stored in LDAP-based directory servers via JNDI Provider.
Set resource security constraints
Add
Set JDBC Domain
Do the following SQL statement in MySQL:
#########
# 用户 表 Create Table Users (user_name varchar (15) Not null primary key, user_pass varchar (15) not null;
# User role table create Table User_roles (user_name varchar (15) Not null, role_name varchar (15) Not null, primary key (user_name, role_name);
INSERT INTO Users VALUES ('MZT', 'Test'); INSERT INTO USER_ROLES VALUES ('mzt', 'mztadmin'); if there is any problem, contact me: WebMaster@bcxy.com