怎样配置tomcat4.0的虚拟路径

moumouren 2002-03-19 11:33:37
想设置一虚拟路径base='/' 实际路径为d:/work 请问该如何配置?恳请大虾们赏脸(分数不是问题)
...全文
7 点赞 收藏 6
写回复
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
huang_brid 2002-03-20

我把我的给你参考一下
<!-- Tomcat Root Context -->

<Context path="" docBase="ROOT" debug="0"/>
<Context path="/test" docBase="c:\corejava" debug="0"/>

运行:http://localhost:8080/test/aaa.jsp
/test可以随便指定,只要与运行时候一样就OK!
aaa.jsp是我用来测试的文件

我的成功了,祝你ok!

回复
moumouren 2002-03-20
经过处理,上面的问题没有了,但出现了新问题:
tomcat重启动后显示:

Starting service Tomcat-Standalone
Apache Tomcat/4.0.3
XmlMapper: Can't find resource for entity: -//Sun Microsystems, Inc.//
pplication 1.2//EN --> http://java.sun.com/j2ee/dtds/web-app_2_2.dtd "n
Starting service Tomcat-Apache
Apache Tomcat/4.0.3

访问网页http://localhost/index.jsp 则显示源码

<%out.println("hello!");%>

而访问http://localhost/examples/jsp/num/numguess.jsp (tomcat的例子)则没有问题。

请各位高手赐教!分数定给!
回复
moumouren 2002-03-20
各位大虾,笨人按各位的意思办了,可重新启动tomcat时出现如下错误,望赐教

Catalina.start: LifecycleException: Error creating server socket (java.net.Bind
Exception): java.net.BindException: Address in use: JVM_Bind
LifecycleException: Error creating server socket (java.net.BindException): jav
a.net.BindException: Address in use: JVM_Bind
at org.apache.catalina.connector.warp.WarpConnector.initialize(WarpConne
ctor.java:491)
at org.apache.catalina.core.StandardService.initialize(StandardService.j
ava:454)
at org.apache.catalina.core.StandardServer.initialize(StandardServer.jav
a:553)
at org.apache.catalina.startup.Catalina.start(Catalina.java:780)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)
----- Root Cause -----
java.net.BindException: Address in use: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:397)
at java.net.ServerSocket.<init>(ServerSocket.java:170)
at java.net.ServerSocket.<init>(ServerSocket.java:121)
at org.apache.catalina.net.DefaultServerSocketFactory.createSocket(Defau
ltServerSocketFactory.java:118)
at org.apache.catalina.connector.warp.WarpConnector.initialize(WarpConne
ctor.java:485)
at org.apache.catalina.core.StandardService.initialize(StandardService.j
ava:454)
at org.apache.catalina.core.StandardServer.initialize(StandardServer.jav
a:553)
at org.apache.catalina.startup.Catalina.start(Catalina.java:780)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)
回复
gamebill 2002-03-19
注意把<-- -->去掉
回复
yanchang 2002-03-19
原由的不动
<!-- Tomcat Root Context -->
<!--
<Context path="" docBase="ROOT" debug="0"/>
-->
天家这么一句:

<Context path="" docBase="D:\\xxx" debug="0"/>

重新启动
回复
liangxuan1979 2002-03-19
你改成
<Context path="" docBase="d:\work " debug="1"
reloadable="false">,其余的不要动,那么http://localhost:port/就是d:\work
回复
发动态
发帖子
Web 开发
创建于2007-09-28

7.9w+

社区成员

Java Web 开发
申请成为版主
社区公告
暂无公告