Al Koch wrote: From this I concluded that pageContext.request.contextPath dynamically resolved to the "WebContent" folder and it is my understanding that this will resolve to this folder no matter what it is named.
However, from all of this I concluded that back in my .java code "request.getContextPath()" would also dynamically resolve to "WebContent". But when I try to forward from the .java code to MyPage.jsp using the string formed from request.getContextPath()+"/WEB-INF/JSP/MyPage.jsp", the JSP cannot be found; this results in a 404 Error - "The Requested Resource (/MyServer/WEB-INF/JSP/MyPage.jsp) is not available". If I call request.getContextPath() with "WEB-INF/JSP/MyPage.jsp" we launch the JSP page. Can someone explain why pre-pending request.getContextPath() causes this to fail and is there something else I should use to ensure that the path to the .JSP is always resolved?
Ram Narayan.M wrote:First of all transfer all WebContent files to proper "war" file. Dont use "WebContent" as root which ServletContainer will regard as ContextPath...
Ram Narayan.M wrote:I was meaning only the context root name "WebContent" that it can be changed since it may look odd... Thats all