quick question about url/jsp mapping
Could anyone clarify whether the following mapping in the web.xml file is possible?
I want to access the file webapps\examples\gate\login.jsp by going to the page http://192.168.2.143:8080/work/login.jsp instead of http://192.168.2.143:8080/examples/gate/login.jsp
Currently I can map it fine to http://192.168.2.143:8080/examples/work/login.jsp,
which is an existing folder, but when I try and get it above the examples folder, it gives me the 404 error.
<servlet>
<servlet-name>Login</servlet-name>
<jsp-file>/gate/login.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>Login</servlet-name>
<url-pattern>/../work/login.jsp</url-pattern>
</servlet-mapping>
Hi lance_dragons ,
Check this Code..once again
<url-pattern>/../work/login.jsp</url-pattern> ,,
no need to specify compleate path in <url-pattern>, just specify work/login.jsp
Even then if not working , post complete webapps structure which u r using ...or attach .....
Cheers
Rajasekhar K
Using only work/login.jsp will cause an error, and the tomcat server to crash, if I use the pattern
<url-pattern>/work/login.jsp</url-pattern>, I just map the URL http://192.168.2.143:8080/examples/work/login.jsp instead of
http://192.168.2.143:8080/examples/gate/login.jsp
My entire webaps structure is rather long, and contains code other than my own, so I'd rather not post it, I just need to figure out if it is possible to map the jsp page to a path above the file. (do you think I need to do it in another web.xml?)