0

I am trying to deploy a war to Tomcat. The name of the war is "Customer.war". After the war gets deployed, I also have to give the name of the war in the URL, for ex: http://localhost:8080/customer/payment/service/add

How can I configure tomcat so that I do not have to give the name of the war 'Customer' in the url. The following is the Url that I want to have:

http://localhost:8080/payment/service/add

How can I force tomcat not to add the war name to the context?

Drunix
  • 3,313
  • 8
  • 28
  • 50
user1717230
  • 443
  • 1
  • 15
  • 30
  • possible duplicate of [HOWTO set the context path of a web application in Tomcat 7.0](http://stackoverflow.com/questions/7276989/howto-set-the-context-path-of-a-web-application-in-tomcat-7-0) – Drunix Mar 27 '14 at 19:31

1 Answers1

0

Name your war ROOT.war, and deploy it.

JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255
  • Assuming that it would work, how do you deploy multiple apps in tomcat , if all the wars should be renamed to root.war – user1717230 Mar 27 '14 at 19:30
  • Well, you can obviously only have one app deployed at the root context. And quite frankly, if one app is deployed at root, you shouldn't have any other app deployed, since apps could use identical URLs. What if your second app also wants a servlet at the path `/payment/service/add`? Context paths are precisely used to make sure that doesn't happen. – JB Nizet Mar 27 '14 at 19:33
  • We would be having multiple apps deployed on our tomcat. Is there any way to deploy all those wars without having the name of the war in the uri – user1717230 Mar 27 '14 at 19:48
  • @user1717230 the operative word here is *ROOT*. It's illogical to expect multiple applications to identify themselves as ROOT to an appserver (without some fancy proxy sitting before the app server) – kolossus Mar 30 '14 at 05:05