This week's book giveaway is in the Beginning Java forum.
We're giving away four copies of Learn Java with Math: Using Fun Projects and Games and have Ron Dai on-line!
See this thread for details.
Win a copy of Learn Java with Math: Using Fun Projects and Games this week in the Beginning Java 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
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

How to change url(context-root) of a web application?

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all

I am currently working with Tomcat 5.5 and deploying one web application on it which is developed using jersey.
The url to the webservice is as follows :

http://localhost:8080/HelloJersey1/hellojersey/hello

Now I want the url to be as follows :

http://localhost:8080/s2/HelloJersey1/hellojersey/hello

How do I do that?I guess this is not a url-pattern which we configure by web-xml.

Thanks in advance
Mansi
 
Saloon Keeper
Posts: 21300
140
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are correct. web.xml does not define the context root, and in fact, no J2EE-standard component does.

The Tomcat Context element defines the context root in its "path=" attribute. The Context Element can be defined in one of 3 places:

1. In a file in the WAR: META-INF/context.xml

2. In the Tomcat configuration: TOMCAT_HOME/conf/Catalina/localhost/xxxxxxx.xml (the "xxxxxxx" can be any valid filename)

3. In the Tomcat server.xml file (STRONGLY discouraged!)

If you deploy a WAR without a Tomcat Context definition, one is synthesized, but then you don't have control over the context root pathname.
 
Tim Holloway
Saloon Keeper
Posts: 21300
140
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are correct. web.xml does not define the context root, and in fact, no J2EE-standard component does.

The Tomcat Context element defines the context root in its "path=" attribute. The Context Element can be defined in one of 3 places:

1. In a file in the WAR: META-INF/context.xml

2. In the Tomcat configuration: TOMCAT_HOME/conf/Catalina/localhost/xxxxxxx.xml (the "xxxxxxx" can be any valid filename)

3. In the Tomcat server.xml file (STRONGLY discouraged!)

If you deploy a WAR without a Tomcat Context definition, one is synthesized, but then you don't have control over the context root pathname.
 
It means our mission is in jeapordy! Quick, read this tiny ad!
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!