Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Cloud Native Transformation: Practical Patterns for InnovationE this week in the Cloud/Virtualization forum
or The Go Workshop in the Go forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Joe Ess
  • salvin francis

Context Path not working

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using tomcat 5.5 and I cant get the context path to work.

I have a folder called phase1 in my tomcat/webapps directory and inside phase1 I have a file called 1.jsp.

I'm trying to make it so the user can go to 1.jsp by going to /secret/test instead of /phase/1.jsp

I have tried adding <Context path="/secret" docbase="phase1/test" reloadable="true"/>

to my server.xml file after the <Host....> part. When I try to load /secret/test it says 404. I tried making a context.xml file and putting in webapps/phase1/META-INF and that didnt work either.

Here are the contents of my web.xml file

<?xml version="1.0" encoding="UTF-8"?>

<web-app>

<!-- General Web Application Description -->
<display-name>a</display-name>

<description>a
</description>

<servlet>
<servlet-name>support</servlet-name>
<jsp-file>/1.jsp</jsp-file>
</servlet>

<servlet-mapping>
<servlet-name>support</servlet-name>
<url-pattern>/test</url-pattern>
</servlet-mapping>

</web-app>



Any suggestions?
 
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just a wild guess, but you're already mapping test to 1.jsp, so the ".../test" part of the docbase would seem to be incorrect.
[ November 02, 2005: Message edited by: Ulf Dittmer ]
 
Jordon Fron
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
nope doesnt work, I tried changing docbase to /phase1 and just phase1

any other suggestions? thanks.
 
The moustache of a titan! The ad of a flea:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!