【发布时间】:2013-05-15 05:50:43
【问题描述】:
只有当资源(比如 test.html)直接位于 eclipse 中的 WebContent 下时,我才能访问它。如果我将它放在 WEB-INF 或 WEB-INF/jsp 中,IDE 会显示错误 404-requested resource is not可用。
http://localhost:8080/MyApp/test.html (This works when test.html is under WebContent and not any of it's subdirectory)
当它在 WebContent/WEB-INF 中时 右键运行到下面的 URL 显示 404-resource not available
http://localhost:8080/MyApp/WEB-INF/test.html
如何通过在 WEB-INF 或 WEB-INF/jsp 中放置“test.html”来访问它?
所有配置都是默认的,在 web.xml 中没有指定限制,并且使用 Tomcat 7 作为 Web 服务器
【问题讨论】: