Tomcat6.0虚拟目录配置:
方法一:
设虚拟目录“test”,通过http://localhost:8080/test访问物理路径F:/jspfile文件夹里面的内容。设置过程如下:
1. 复制Tomcat6.0/webapps/ROOT目录下的WEB-INF文件夹到F:/jspfile目录下。
2. 打开D:/site/WEB-INF目录下的web.xml文件,在</description>之后加入:
<!--JSPC servlet mappings start -->
<!--JSPC servlet mappings end -->
3. 打开Tomcat5.0/conf/server.xml文件,在<Host>和</Host>之间加入:
<Context path=”/test” docBase=” F:/jspfile”></Context>
path=”/test”就是虚拟目录的名称 docBase=” F:/jspfile”>为物理路径
4. 打开Tomcat6.0/conf/web.xml文件,找到:
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
把false设成true 保存,重启Tomcat,现在就可以应用http://localhost:8080/test 虚拟目录了
方法二:
设虚拟目录“test”,通过http://localhost:8080/test访问物理路径F:/jspfile文件夹里面的内容。设置过程如:
1. 复制Tomcat6.0/webapps/ROOT目录下的WEB-INF文件夹到F:/jspfile目录下。
2. 打开D:/site/WEB-INF目录下的web.xml文件,在</description>之后加入:
<!--JSPC servlet mappings start -->
<!--JSPC servlet mappings end -->
3. 打开Tomcat6.0/conf/web.xml文件,找到:
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
把false设成true 保存,重启Tomcat,现在就可以应用http://localhost:8080/test 虚拟目录了
4. 打开Tomcat6.0/conf目录在下面建立Cataline/localhost目录在该目录下建立名为text.xml文件(该文件名就是虚拟目录的名称)内容为:
<Context path=”/test” docBase=”F:/jspfile”></Context>