解决The origin server did not find a current representation for the target resource or is not导致的404问题


解决The origin server did not find a current representation for the target resource or is not导致的404问题
感谢->https://blog.****.net/qq_38701478/article/details/88081505

问题原因:路径错误

学习java过程中遇到该错误真的是头疼啊,使用idea启动,解决该问题有3种方法,方法大同小异,最终目的是为了配置文件能找到jsp页面。
参考链接里有说明:
1、公开的信息放到webapp目录下,受保护的信息放到web-info下面。
2、web-info下面是受保护的页面一般不能直接访问,需要通过controller访问或者配置servlet访问。一般首页是属于公开的信息,所有人都可以访问,所以要放到webapp下面。
既然如此那么解决起来就容易了。

方法一: 把页面从web-info中移到webapp。

方法二:不改变jsp页面位置时,在xx.jsp页面路径前加上/WEB-INF/

<welcome-file-list> <welcome-file>/WEB-INF/index.jsp</welcome-file> </welcome-file-list>
解决The origin server did not find a current representation for the target resource or is not导致的404问题

方法三:在不改变jsp页面位置时,修改Modules->Web->Web Resource Directories路径

解决The origin server did not find a current representation for the target resource or is not导致的404问题

记录一下解决方法,希望也能帮助到你^ _ ^