日期:2014-05-18  浏览次数:20690 次

tomcat默认首页设置问题
我想在地址栏里写http://localhost

然后就直接跳到C:\Program   Files\Apache   Software   Foundation\Tomcat   5.5\webapps\home\index.jsp
这样怎么设置呢?

------解决方案--------------------
首先在server.xml中修改端口号为80
<Connector port= "80 "
maxThreads= "150 " minSpareThreads= "25 " maxSpareThreads= "75 "
enableLookups= "false " redirectPort= "8443 " acceptCount= "100 "
debug= "0 " connectionTimeout= "20000 "
disableUploadTimeout= "true " />
然后修改默认Host根目录为home(appBase= "home ")
<Host name= "localhost " debug= "0 " appBase= "home "
unpackWARs= "true " autoDeploy= "true "
xmlValidation= "false " xmlNamespaceAware= "false ">
试试看吧
------解决方案--------------------
把webapp\root\web.xml
的 <servlet>
<servlet-name> org.apache.jsp.index_jsp </servlet-name>
<servlet-class> org.apache.jsp.index_jsp </servlet-class>
</servlet>

<servlet-mapping>
<servlet-name> org.apache.jsp.index_jsp </servlet-name>
<url-pattern> /index.jsp </url-pattern>
</servlet-mapping>
删除掉加上
<welcome-file-list>
<welcome-file> ..\home\index.jsp </welcome-file>
</welcome-file-list>
------解决方案--------------------
使用默认的80端口,然后在web.xml中配置起始页