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

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -