Tomcat——tomcat配置文件方式部署项目

一、采用配置文件的方式配置

例如:

将tomcat-6.0.30.rar解压到D:\Program Files\目录,并将pas.xml文件拷贝到D:\Program Files\ tomcat-6.0.30\conf\Catalina\localhost目录。(Tomcat的部署方式有多种,这里我们采用配置文件的方式部署,即上面用到的pas.xml配置文件。)

<Context docBase="D:\tiancom\workspace\TAPAS\WebRoot" privileged="true" antiResourceLocking="false" antiJARLocking="false" useHttpOnly="true"></Context>

这样输入pas就可以访问tapas项目了,然后走web.xml配置文件访问首页。这样的好处是项目可以直接用tomcat发布项目

二、web.xml文件配置
http://localhost:8080/ssh这样他就会打开index.jsp,因为这样他会默认找WebRoot下面的index.jsp,这个是在web.xml中配置welcome-file。
<welcome-file-list>
    <welcome-file>index.jsp</welcome-file> </welcome-file-list>

猜你喜欢

转载自www.cnblogs.com/wy20110919/p/9134061.html