2015/12/11
呀。。师弟果然牛逼。
具体要分2步走:
要把项目放在webapps/目录下(相对路径)
1.修改server.xml文件
注意,这里的server.xml不是在javaee里面servers项目里面的那个,是安装tomcat的文件夹里面conf/server.xml
比如:E:\apache-tomcat-6.0.43\conf\
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="Demo" reloadable="true" />
</Host>
增加了<Context path="" docBase="Demo" reloadable="true" />
本地和网上Linux发布不同,此资料适用Linux发布
docBase这里面只能有项目名,不能携带具体文件如demo/jsp
2.有了项目,就要设置具体的页面(html,jsp,等)
错误的→(在相同的conf/下面找到web.xml)
正确的→(项目里面的web.xml)
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
设置项目的开始页面!
附加:
最重要一点忘记说了,改完要重启服务,不能再javaee里面重启,得在
E:\apache-tomcat-6.0.43\bin(tomcat安装目录) startup.bat重启
资料来源:
http://www.cnblogs.com/icerainsoft/archive/2012/11/08/2760848.html