JEE设置默认JSP页面 报错The origin server did not find a current representation for the t

589 阅读1分钟
  • 出现这样的错误有多种原因,本次我所解决的是没有设置默认加载及视频页面。
  • 简单阐述更改经验及心理路程,在出现这个错误的时候我就蒙了,我之间创建的一个项目就可以加载,现在创建一个项目就没法加载了,跟奇怪的是我输入localhost:8080就可以加载 如图:
    之后输入localhost:8080:/Shopping/admin/login.jsp 就会出现这种情况 如图:

我在查了很多资料后,发现可能是没有配置web.xml 打开web.xml果然是没有配置,如图:

  • 之后在添加配置后就可以运行了
  <display-name>Shopping</display-name>
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>default.html</welcome-file>
        <welcome-file>default.htm</welcome-file>
        <welcome-file>default.jsp</welcome-file>
    </welcome-file-list>

  • 最后输入路径 运行结果如图:

总结

  • 遇到Bug不要方,不要方,不要方
  • 多思考,查资料
  • 要有耐心