关于server.xml中定义的ubuntu:tomcat上下文未加载

tomcat context defined in server.xml is not loading

我在路径上部署了Web应用程序

1
/var/lib/tomcat6/webapps/abc/</wyn>

在路径/etc/tomcat/server.xml上的server.xml中,我添加了以下几行。

1
2
3
4
5
<Context docBase="/var/lib/tomcat6/webapps/abc/" path="/" reloadable="true">

  <Resource auth="Container" driverClassName="com.mysql.jdbc.Driver" maxActive="20" maxIdle="10" maxWait="10000" name="jdbc/abcDB" password="abc" type="javax.sql.DataSource" url="jdbc:mysql://localhost:3306/abc" username="abc"/>

</Context>

在主机标签中。

当我重新启动tomcat并按下http://localhost:8080/时,什么都没出现,但是当我进入http://localhost:8080/abc主页时,这表示server.xml中的上述输入未生效。

我究竟做错了什么 ??


看起来您想将webapp abc设置为默认Web应用程序(即直接通过http:// localhost:8080 /访问它),然后在Context中将路径指定为""而不是" /"

从Tomcat文档中,

If you specify a context path of an
empty string (""), you are defining
the default web application for this
Host, which will process all requests
not assigned to other Contexts