1、server.xml中增加
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml"/>
<Resource name="jdbc/struts" auth="Container"
type="javax.sql.DataSource"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/struts?characterEncoding=UTF-8"
username="root"
password="root"
maxActive="200"
maxIdle="50"
maxWait="3000"/>
2、context.xml中增加
<ResourceLink name="jdbc/struts" global="jdbc/struts" type="javax.sql.DataSource"/>