C:\Tomcat 5.0\conf\web.xml 已经设置
并且在地址栏输入: http://192.168.61.128:8000/new/ 可以打开new下的index.jsp
现在我想做到的是地址栏输入: http://192.168.61.128:8000/也能打开new下的index.jsp
C:\Tomcat 5.0\conf\server.xml 已经做过修改如下:(已经重新启动tomcat和pc)<!-- Example Server Configuration File -->
<!-- Note that component elements are nested corresponding to their
parent-child relationships with each other --><!-- A "Server" is a singleton element that represents the entire JVM,
which may contain one or more "Service" instances. The Server
listens for a shutdown command on the indicated port. Note: A "Server" is not itself a "Container", so you may not
define subcomponents such as "Valves" or "Loggers" at this level.
--><Server port="8005" shutdown="SHUTDOWN" debug="0">
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
debug="0"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
debug="0"/> <!-- Global JNDI resources -->
<GlobalNamingResources> <!-- Test entry for demonstration purposes -->
<Environment name="simpleValue" type="java.lang.Integer" value="30"/> <!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users -->
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved">
</Resource>
<ResourceParams name="UserDatabase">
<parameter>
<name>factory</name>
<value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
</parameter>
<parameter>
<name>pathname</name>
<value>conf/tomcat-users.xml</value>
</parameter>
</ResourceParams> </GlobalNamingResources>
<!-- Define the Tomcat Stand-Alone Service -->
<Service name="Catalina"> <Connector
port="8000" maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
debug="0" connectionTimeout="20000"
disableUploadTimeout="true" useBodyEncodingForURI="true" URIEncoding="UTF-8"/>
<Connector port="8009"
enableLookups="false" redirectPort="8443" debug="0"
protocol="AJP/1.3" /> <Engine name="Catalina" defaultHost="localhost" debug="0"> <!-- Because this Realm is here, an instance will be shared globally --> <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
debug="0" resourceName="UserDatabase"/> <!-- Comment out the old realm but leave here for now in case we
need to go back quickly -->
<Host name="localhost" debug="0" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<!-- Normally, users must authenticate themselves to each web app
individually. Uncomment the following entry if you would like
a user to be authenticated the first time they encounter a
resource protected by a security constraint, and then have that
user identity maintained across *all* web applications contained
in this virtual host. -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn"
debug="0"/>
--> <!-- Access log processes all requests for this virtual host. By
default, log files are created in the "logs" directory relative to
$CATALINA_HOME. If you wish, you can specify a different
directory with the "directory" attribute. Specify either a relative
(to $CATALINA_HOME) or absolute path to the desired directory.
-->
<!--
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs" prefix="localhost_access_log." suffix=".txt"
pattern="common" resolveHosts="false"/>
--> <!-- Logger shared by all Contexts related to this virtual host. By
default (when using FileLogger), log files are created in the "logs"
directory relative to $CATALINA_HOME. If you wish, you can specify
a different directory with the "directory" attribute. Specify either a
relative (to $CATALINA_HOME) or absolute path to the desired
directory.-->
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="localhost_log." suffix=".txt"
timestamp="true"/>
<Context path="" docBase="C:\Tomcat 5.0\webapps\new" debug="0" reloadable="true" crossContext="true"/>
</Host> </Engine> </Service></Server>
并且在地址栏输入: http://192.168.61.128:8000/new/ 可以打开new下的index.jsp
现在我想做到的是地址栏输入: http://192.168.61.128:8000/也能打开new下的index.jsp
C:\Tomcat 5.0\conf\server.xml 已经做过修改如下:(已经重新启动tomcat和pc)<!-- Example Server Configuration File -->
<!-- Note that component elements are nested corresponding to their
parent-child relationships with each other --><!-- A "Server" is a singleton element that represents the entire JVM,
which may contain one or more "Service" instances. The Server
listens for a shutdown command on the indicated port. Note: A "Server" is not itself a "Container", so you may not
define subcomponents such as "Valves" or "Loggers" at this level.
--><Server port="8005" shutdown="SHUTDOWN" debug="0">
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
debug="0"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
debug="0"/> <!-- Global JNDI resources -->
<GlobalNamingResources> <!-- Test entry for demonstration purposes -->
<Environment name="simpleValue" type="java.lang.Integer" value="30"/> <!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users -->
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved">
</Resource>
<ResourceParams name="UserDatabase">
<parameter>
<name>factory</name>
<value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
</parameter>
<parameter>
<name>pathname</name>
<value>conf/tomcat-users.xml</value>
</parameter>
</ResourceParams> </GlobalNamingResources>
<!-- Define the Tomcat Stand-Alone Service -->
<Service name="Catalina"> <Connector
port="8000" maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
debug="0" connectionTimeout="20000"
disableUploadTimeout="true" useBodyEncodingForURI="true" URIEncoding="UTF-8"/>
<Connector port="8009"
enableLookups="false" redirectPort="8443" debug="0"
protocol="AJP/1.3" /> <Engine name="Catalina" defaultHost="localhost" debug="0"> <!-- Because this Realm is here, an instance will be shared globally --> <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
debug="0" resourceName="UserDatabase"/> <!-- Comment out the old realm but leave here for now in case we
need to go back quickly -->
<Host name="localhost" debug="0" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<!-- Normally, users must authenticate themselves to each web app
individually. Uncomment the following entry if you would like
a user to be authenticated the first time they encounter a
resource protected by a security constraint, and then have that
user identity maintained across *all* web applications contained
in this virtual host. -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn"
debug="0"/>
--> <!-- Access log processes all requests for this virtual host. By
default, log files are created in the "logs" directory relative to
$CATALINA_HOME. If you wish, you can specify a different
directory with the "directory" attribute. Specify either a relative
(to $CATALINA_HOME) or absolute path to the desired directory.
-->
<!--
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs" prefix="localhost_access_log." suffix=".txt"
pattern="common" resolveHosts="false"/>
--> <!-- Logger shared by all Contexts related to this virtual host. By
default (when using FileLogger), log files are created in the "logs"
directory relative to $CATALINA_HOME. If you wish, you can specify
a different directory with the "directory" attribute. Specify either a
relative (to $CATALINA_HOME) or absolute path to the desired
directory.-->
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="localhost_log." suffix=".txt"
timestamp="true"/>
<Context path="" docBase="C:\Tomcat 5.0\webapps\new" debug="0" reloadable="true" crossContext="true"/>
</Host> </Engine> </Service></Server>
解决方案 »
- c3p0 连接内存溢出问题
- 有关freemarker包含另一个jsp页面的问题
- 问下jsp
- 为何我的struts2 标签怎么会出现这种情况
- 求jQuery最全书籍
- javabean求救!大哥大姐帮帮忙啊!初学者好可怜啊!
- 关于jfreechart曲线图鼠标放在曲线上可以显示具体数值的问题,希望能够得到您的指点
- Hibernate 基于主键的单向1-1
- JSP中连接ORALCE,TOMCAT报错,问如何修改!!
- 求通过IP判断地区的方法?
- java.lang.IllegalArgumentException: Wrong target. class com.iwtxokhtd.ejb.UserManagerBean for public void com.iwtxokhtd.ejb.User
- java mail的函数为什么cannot be resolved
楼主【hongguang5885】截止到2008-07-02 19:57:33的历史汇总数据(不包括此帖):
发帖的总数量:4 发帖的总分数:80
结贴的总数量:4 结贴的总分数:80
无满意结贴数:0 无满意结贴分:0
未结的帖子数:0 未结的总分数:0
结贴的百分比:100.00% 结分的百分比:100.00%
无满意结贴率:0.00 % 无满意结分率:0.00 %
敬礼!
试下。。
</Host>
</Engine> </Service> </Server> 加上/ 也不行
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<Context path="/" docBase="C:\Tomcat 5.0\webapps\new" debug="0" privileged="true" reloadAble="true" />
到底是改哪个文件?
xmlValidation="false" xmlNamespaceAware="false"> <Context path="" docBase="C:\Tomcat 5.0\webapps\new" reloadable="false" />
好像这个还有再改一下: <Engine name="Catalina" defaultHost="192.168.61.128" debug="0">
修改紧接着的<Context path="" docBase="../../webinf" debug="0"/>中的docbase项即可我的conf目录下的server.xml文件,找不到上面的东西呀?
<welcome-file>/new/index.jsp </welcome-file>
</welcome-file-list>
11楼的和我写的不是一个样子吗?
不过我用的是TOMCAT50
1.在E:\MYJAVA\TOMCATJSP下新建一个文件夹work(为空即可).
2.SERVER.XML文件修改如下:
在</Host>之前加上:
<Context path="" reloadable="true" docBase="C:\Tomcat 5.0\webapps\new" workDir="C:\Tomcat 5.0\webapps\new\work"/>
3.重启TOMCAT
4.在地址栏里输入:
http://localhost
(^_^)这个死猫可不见了.................
虽然有了实际可行的答案,但是还不是很理解,请高手详细指点!知其然更要知其所以然才对!!
不过我用的是TOMCAT50
1.在C:\Tomcat 5.0\webapps\new下新建一个文件夹work(为空即可).
2.SERVER.XML文件修改如下:
在 </Host>之前加上:
<Context path="" reloadable="true" docBase="C:\Tomcat 5.0\webapps\new" workDir="C:\Tomcat 5.0\webapps\new\work"/>
3.重启TOMCAT
4.在地址栏里输入:
http://localhost
(^_^)这个死猫可不见了.................
虽然有了实际可行的答案,但是还不是很理解,请高手详细指点! 知其然更要知其所以然才对!!