Tomcat配置根目录默认页面

方法一:
修改tomcat的server.xml(这种方法试过了,挺好用)

< Host  name ="localhost"  debug ="0"  appBase ="webapps" 
unpackWARs ="true"  autoDeploy ="true" 
xmlValidation ="false"  xmlNamespaceAware ="false" > 

   < Logger  className ="org.apache.catalina.logger.FileLogger" 
           directory ="logs"   prefix ="localhost_log."  suffix =".txt" 
      timestamp ="true" /> 

  < Context  path =""  docBase ="xxxxxx"  debug ="0" /> 
</ Host > 

 
方法二:
将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 > 

 
删掉

 

你可能感兴趣的:(apache,tomcat,xml,jsp,servlet)