我在tomcat的webapps下布署的web应用名mywebapp,里面还有一层WebRoot,而那个index.jsp也是在WebRoot下.
mywebapp/WebRoot/index.jsp.当我在IE里面输入http://localhost:8080/mywebapp时,我希望tomcat到/mywebapp/WebRoot下去寻找,我应该怎么做呢?
mywebapp/WebRoot/index.jsp.当我在IE里面输入http://localhost:8080/mywebapp时,我希望tomcat到/mywebapp/WebRoot下去寻找,我应该怎么做呢?
在<Host>部分的尾部加上
<Context path="/aaa" docBase="F:/mywebapp/WebRoot"
debug="5" reloadable="true" crossContext="true"><Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="localhost_page_log." suffix=".txt"
timestamp="true"/></Context>
如果还有其它应用,那我岂不是每多一个应用都要加这么一个Context标签?
我想写成不管在http://localhost:8080/后面输入什么,它都会自动到下一级WebRoot下面去找?
mywebapp/WEB-INF/web.xml中加入: <welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
</welcome-file-list>