在你的http://localhost对应的目录下放一个index.jsp
内容为
<%
response.sendRedirect("mytest/index.jsp");
%>
或者
<script language="javascript">
window.location="mytest/index.jsp";
</script>
或者
<meta refresh="0" url="mytest/index.jsp">

解决方案 »

  1.   

    做个index.jsp直接response到/mytest/index.jsp
      

  2.   

    修改
    tomcat_home/conf/server.xml文件中<Context path="" docBase="mytest/"
            debug="0" privileged="true">就可以了。
      

  3.   

    那位头顶星星的人的意见是可行的,不过你要先把tomcat里面默认的那个改掉
      

  4.   

    补充一下我的环境
      webapp
        |_ROOT
        |_mytest能给出具体的代码吗,我急用啊,加分都行啊
      

  5.   

    TO:Leemaasn(呆鸟一号) 
    好象是不行哟,还是默认的ROOT下的index.jsp
    我也试了!
      

  6.   

    修改
    tomcat_home/conf/server.xml文件中<Context path="" docBase="mytest"
            debug="0" privileged="true">還有web.xml
      <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
      </welcome-file-list>
    就可以了。
      

  7.   

    to:54sunboy(舍我其谁) (
    真的那样,不行啊,还是默认的那个ROOT/index.jsp我试了很多次了!
      

  8.   

    tomcat要重启啊
    你修改完server.xml后必须重启才生效的
      

  9.   

    用转向<meta refresh="0" url="mytest/index.jsp">
      

  10.   

    TO:FFF123这点我知道呀,真的没有变,会是什么原因呢?!:(
      

  11.   

    yong <meta refresh="0" url="mytest/index.jsp">
      

  12.   

    >>那位头顶星星的人的意见是可行的,不过你要先把tomcat里面默认的那个改掉
    谢谢, 说的对,我已经做成功了,
    谢谢楼上各位的帮忙了<Context path="" docBase="mytest/"
            debug="0" privileged="true"/>  不要忘了反斜杠
    删除<Context path="" docBase="ROOT"
            debug="0"/>    
    path定义的是http访问的路径,为空,表示根目录。docBase定义与该路经相关的文件系统路径,可以是相对路径