Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP URL pattern problem in Tomcat

 
B Bhutta
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic