1.問題描述:
eclipse中使用tomcat來運作helloworld時出現the requested resource is not available.
在報錯中有一行setting property 'source' to 'org.eclipse.jst.jee.server:helloworld' did not find a matching property
運作環境eclipse,tomcat-8.0.20,javaweb
1.2解決辦法:
将helloworld.jsp檔案放在/webcontent下,而不是放在/webcontent/web-inf或者其他的地方。簡而言之是你的jsp檔案位置了。如圖
如此放對位置就解決了無法通路的問題。
參看官方文獻http://www.eclipse.org/forums/index.php/t/516714/
“the jsp files placed directly in web-inf are not served by the container to the client (see servlet 3.0 specification, section 10.5: directory structure, page 99). to solve this, the jsp file should
be located in webcontent.”
題外話:這個問題困擾了我一整天,說實話,找到那些所謂的解決辦法真是折騰人啊,那些辦法幾年前可能管用,但是文章抄來抄去的,問題本質變了,卻沒有更新解決辦法。
記錄日期:2015/3/22