deployment - web.xml and relative paths -
in web.xml set welcome file jsp within web.xml
<welcome-file>web-inf/index.jsp</welcome-file>
inside index.jsp forward on servlet
<% response.sendredirect(response.encoderedirecturl("myservlet/")); %>
however application tries find servlet @ following path
applicationname/web-inf/myservlet
the problem web-inf should not in path. if move index.jsp out of web-inf problem goes there way can around this?
<% response.sendredirect(response.encoderedirecturl("/myservlet/")); %>`
since jsp served web-inf directory servlet url resolved relative path. adding / before resolve url context root
Comments
Post a Comment