permaculture playing cards*
The moose likes Servlets and the fly likes JSP URL pattern problem in Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "JSP URL pattern problem in Tomcat" Watch "JSP URL pattern problem in Tomcat" New topic
Author

JSP URL pattern problem in Tomcat

B Bhutta
Greenhorn

Joined: Jun 28, 2002
Posts: 14
Hi,
I have a simple servlets/jsp application running under tomcat 4.3.1 in linux environment. Currently all my jsp's are located under jsp directory under application root.

To access my home jsp, for my test context root of the application, I have to write URL;
...localhost:8080/test/jsp/home.jsp
I would like to use hide my directory structure and the jsp file names and call the URL as:
...localhost:8080/test/home
which should get me the same jsp page. I have tried several ways and tried to make the following change in my web.xml but no luck.
<servlet>
<servlet-name>homeJSP</servlet-name>
<display-name>home</display-name>
<jsp-file>/jsp/home.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>homeJSP</servlet-name>
<url-pattern>/home</url-pattern>
</servlet-mapping>



Using the URL:
...localhost:8080/test/home

give me the error:
org.apache.jasper.JasperException
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:207)
...


However, if I use the URL
...localhost:8080/test/jsp/home.jsp
It works well. Your help will be appreciated.
Thanks.

[ March 24, 2006: Message edited by: B Bhutta ]
[ March 24, 2006: Message edited by: B Bhutta ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP URL pattern problem in Tomcat
 
Similar Threads
web.xml & JSP
JSP load on startup
Tomcat unable to locate the Servlet class
trouble loading servlet class on Tomcat4.1.24
Running Servlets, have a question