• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSP URL pattern problem in Tomcat

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic