今天试用了JSP空间,
程序与提供商有一些矛盾,提供商允许我们改server.xml
那问题就来,我用了JNDI
这早就意识到,就把JNDI抽取到conf/Catalina/localhost目录
如test.xml
<?
xml version="1.0" encoding="UTF-8"
?>
< Context path ="/test" reloadable ="true" docBase ="D:\web\test" workDir ="D:\web\test\WEB-INF\work" >
< Resource
name ="jdbc/TEST"
type ="javax.sql.DataSource"
password =""
driverClassName ="com.mysql.jdbc.Driver"
maxIdle ="2"
maxWait ="5000"
username ="root"
url ="jdbc:mysql://localhost:3306/test"
maxActive ="4" />
</ Context >
< Context path ="/test" reloadable ="true" docBase ="D:\web\test" workDir ="D:\web\test\WEB-INF\work" >
< Resource
name ="jdbc/TEST"
type ="javax.sql.DataSource"
password =""
driverClassName ="com.mysql.jdbc.Driver"
maxIdle ="2"
maxWait ="5000"
username ="root"
url ="jdbc:mysql://localhost:3306/test"
maxActive ="4" />
</ Context >
这还是麻烦,最后技术人员建议在META-INF/目录下放context.xml
<?
xml version="1.0" encoding="UTF-8"
?>
< Context >
< Resource
name ="jdbc/TEST"
type ="javax.sql.DataSource"
password =""
driverClassName ="com.mysql.jdbc.Driver"
maxIdle ="2"
maxWait ="5000"
username ="root"
url ="jdbc:mysql://localhost:3306/test"
maxActive ="4" />
</ Context >
< Context >
< Resource
name ="jdbc/TEST"
type ="javax.sql.DataSource"
password =""
driverClassName ="com.mysql.jdbc.Driver"
maxIdle ="2"
maxWait ="5000"
username ="root"
url ="jdbc:mysql://localhost:3306/test"
maxActive ="4" />
</ Context >