1、将端口号配置成80 ,则http://localhost 就会显示 apache主页 不用打http://localhost:8080    (这一步不是必须的)

  <Connector port="8080" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />

  conf\server.xml将8080改为80

2、在server.xml 的</host>之前添加

<Context crossContext="true" docBase="文件路径" path="需要映射的路径" reloadable="true"> </Context>
例子
<Context crossContext="true" docBase="F:\MyJsp" path="/jsp" reloadable="true"> </Context>

3、修改conf\web.xml中xml 代码为false 为true:

<init-param>
<param-name>listings</param-name>
<param-value>true</param-value>
</init-param>

4、Tomcat6.0\webapps\ROOT 目录下WEB-INF 文件到F:\MyJsp中。

访问http://localhost/jsp/ 则会显示如下
jsp---->tomcat配置虚拟目录

 

相关文章:

  • 2021-09-20
  • 2021-04-10
  • 2021-11-30
  • 2021-11-30
猜你喜欢
  • 2021-12-15
  • 2021-11-30
  • 2021-06-29
  • 2021-04-23
  • 2021-08-17
相关资源
相似解决方案