0

When i am creating context path in server.xml of tomcat server then everything is working fine. But I want to write context element in context.xml to define different URL to same application then it is not working. Please explain how to modify context.xml to read the path from context.xml. like :

<Context path="/vk" docBase="E:\java\MyProject\apache-tomcat-7.0.19\webapps\test" reloadable="true" />
Ian Roberts
  • 120,891
  • 16
  • 170
  • 183
vishal
  • 323
  • 1
  • 2
  • 9

1 Answers1

1

Tomcat takes the context path from the name of the war file (or directory under webapps). If you want to deploy your app as /vk then name it vk.war, or /foo/bar name it foo#bar.war

To deploy the same app at two different paths, put it outside the webapps dir, then create context definition files in conf/Catalina/localhost named test.xml, vk.xml etc. you don't need a path attribute, again the context path is deduced from the name of the file.

Ian Roberts
  • 120,891
  • 16
  • 170
  • 183