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>

解决方案 »

  1.   

    此回复为自动发出,仅用于显示而已,并无任何其他特殊作用
    楼主【hongguang5885】截止到2008-07-02 19:57:33的历史汇总数据(不包括此帖):
    发帖的总数量:4                        发帖的总分数:80                       
    结贴的总数量:4                        结贴的总分数:80                       
    无满意结贴数:0                        无满意结贴分:0                        
    未结的帖子数:0                        未结的总分数:0                        
    结贴的百分比:100.00%               结分的百分比:100.00%                  
    无满意结贴率:0.00  %               无满意结分率:0.00  %                  
    敬礼!
      

  2.   

    <Context path="/
    试下。。
      

  3.   

    <Context path="/" docBase="C:\Tomcat 5.0\webapps\new" debug="0" reloadable="true" crossContext="true"/> 
          </Host> 
    </Engine>   </Service> </Server> 加上/ 也不行
      

  4.   

    这个好象得配置项目中的Web.xml文件吧!<welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
      </welcome-file-list>
      

  5.   

    在c:\Tomcat5.0\conf\Catalina\localhost下建一个xml文件内容如下:
    <Context path="/" docBase="C:\Tomcat 5.0\webapps\new" debug="0" privileged="true" reloadAble="true" />
      

  6.   

    网上查到的都是修改c:\Tomcat5.0\conf\server。xml
    到底是改哪个文件?
      

  7.   

    <Host name="192.168.61.128" debug="0" appBase="webapps"unpackWARs="true" autoDeploy="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">
      

  8.   

    <Context path="" docBase="C:\Tomcat 5.0\webapps\new" reloadable="false" /> 
      

  9.   

    修改conf目录下的server.xml文件,找到                 <!--   Tomcat   Root   Context   -->   项   
      修改紧接着的<Context   path=""   docBase="../../webinf"   debug="0"/>中的docbase项即可我的conf目录下的server.xml文件,找不到上面的东西呀?
      

  10.   

    <welcome-file-list> 
        <welcome-file>/new/index.jsp </welcome-file> 
    </welcome-file-list>
      

  11.   

    10楼的我很不理解,难道 name="localhost" 和name="192.168.61.128" 有区别吗?
    11楼的和我写的不是一个样子吗?
      

  12.   

    谢谢楼上各位,在网上周转了2天终于给弄好了.好累.............   
      不过我用的是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   
      (^_^)这个死猫可不见了.................   
    虽然有了实际可行的答案,但是还不是很理解,请高手详细指点!知其然更要知其所以然才对!!
      

  13.   

    最简单的方法就是把你的文件全放到ROOT目录下就可以了
      

  14.   

    谢谢楼上各位,在网上周转了2天终于给弄好了.好累.............  
      不过我用的是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  
      (^_^)这个死猫可不见了.................  
    虽然有了实际可行的答案,但是还不是很理解,请高手详细指点! 知其然更要知其所以然才对!!
      

  15.   

    hongguang5885   谢谢你  这两天查了好多 看到你的回答 才明白