maven jetty datasource 配置不好用

Edith1988 2017-01-13 01:51:13
file11: web.xml
...
<resource-ref>
<description>The tokenDB DataSource Reference</description>
<res-ref-name>synnex/jdbc/tokenDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
...
file2:jetty.xml
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure id="Server" class="org.eclipse.jetty.server.Server">
<New id="tokenDB" class="org.eclipse.jetty.plus.jndi.Resource" >
<Arg></Arg>
<Arg>synnex/jdbc/tokenDB</Arg>
<Arg>
<New class="com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource" >
<Set name ="Url">jdbc:mysql://localhost:3308/mydb?allowMultiQueries=true</Set>
<Set name ="User">test</Set>
<Set name ="Password">test</Set>
</New>
</Arg>
</New>
file3:pom.xml
...
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.5.v20120716</version>
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
<jettyXml>src/main/resources/jetty.xml</jettyXml>
<webApp>
<contextPath>/creditcard-token</contextPath>
</webApp>
</Configure>
....
...全文
113 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

5,657

社区成员

发帖
与我相关
我的任务
社区描述
Web开发应用服务器相关讨论专区
社区管理员
  • 应用服务器社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧