最近编了一个index.jsp小程序,工具用的是eclipse+tomcat+jdk+mysql,程序在编译环境下运行成功,想通过http//localhost:8080/来访问,结果老是出来tomcat的默认主页(即有只小猫的图像的那个),没有进入我编辑的index页面。为什么?该如何解决?

解决方案 »

  1.   

    http//localhost:8080/index.jsp 试试
      

  2.   

    http://localhost:8080/ 后面是webapp名称接/index.jsp例如
    http://localhost:8080/demo/index.jsp
      

  3.   

    也有可能是端口问题,mysql也用80的端口,把tomcat的端口改一下试试
      

  4.   

    MyEclipse里右键你的项目---properties---MyEclipse---Web---看你的Web context-root是什么,如果是/demo的话,就这样访问http://localhost:8080/demo/index.jsp!楼主试试!
      

  5.   

    把你的index.jsp放在一个文件夹下,这个文件夹放在webapps下
    http://localhost:8080/文件夹名
      

  6.   

    http://localhost:8080/web工程名/index.jsp
    或者
    http://localhost:8080/web工程名/
      

  7.   

    将你的war包直接替换webapp/ROOT夹里的内容,再通过http://localhost:8080来访问,应该就可以达到你想要的效果了。
      

  8.   


    楼上正解,还有一种就是你要把完整的文件名也写出来,比如你放在webapp/sss下,则写http://localhost:8080/sss/你的网页的名字,如果你没有配置web.xml的话
      

  9.   

    还有在web.xml中 
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
      </welcome-file-list>
    设置index.xml