配置jndi数据源
META-INF中加入配置文件
context.xml
<Context reloadable="true" crossContext="true">
<ResourceLink name="jdbc/mysql" global="jdbc/dbcp/mysql/项目" type="java.sql.DataSource">
</ResourceLink>
</Context>
spring配置文件中加入
</bean>
在tomcat的server.xml中加入