• 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

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

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 27807
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 27807
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic