• 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

Problem with contextPath

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everybody. I have a problem with my Java-Application. I've created a war-file of my application and deployed it with JBoss. The application works fine but I can only call the applicication with the contextPath "/bank" which is automatically set by JBoss. How can I change the contextPath? Thank you.
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In your war file create a jboss-web.xml under the WEB-INF folder with the following contents:



You can then access your application at http://server:port/NameOfYourChoice
[ September 11, 2008: Message edited by: Jaikiran Pai ]
 
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you have your application package in an EAR file??

If this is the case then you should have a META-INF/application.xml in the root of that EAR. In this application.xml there should be a and here you need to change the "context-root" name.

If you only have a WAR file then the name of this file will be the name of your context.
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh yes, i forgot about the EAR files. Rene, is right - For EARs the application.xml is the right place to set this. For WAR files, see my earlier reply.
 
Martin Reuter
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't have a ear-file. I only have a war-file.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmm...
You can create jboss-web.xml under WEB-INF folder of WAR file.
Specify context-root in jboss-wex.xml.
<jboss-web>
<context-root>sanjay</context-root>
</jboss-web>


Sanjay.
 
Rene Larsen
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Sanjay Madhu:
Hmm...
You can create jboss-web.xml under WEB-INF folder of WAR file.
Specify context-root in jboss-wex.xml.
<jboss-web>
<context-root>sanjay</context-root>
</jboss-web>


Sanjay.



Exactly the same as Jaikiran wrote earlier...
 
It wasn't my idea to go to some crazy nightclub in the middle of nowhere. I just wanted to stay home and cuddle with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic