1

I have a situation here i have an application in jsf-2.1 which is deployed as http://localhost:8080/myWebApplication and in "META-INF" i have context.xml which has the following configuration

<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path="/myWebApplication" />

Now i want to shorten the name without loosing context => 'myWebApplication' like '/mwp'

i tried to do the following but it did not work out as expected:

<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path="/myWebApplication" />
<Context antiJARLocking="true" path="/mwp" />

Please advise if it is possible or is there any workaround to achieve this.

BalusC
  • 992,635
  • 352
  • 3,478
  • 3,452
Adyz
  • 320
  • 4
  • 17
  • Found it here http://stackoverflow.com/questions/11721966/how-can-i-map-multiple-contexts-to-the-same-war-file-in-tomcat – Adyz Feb 13 '14 at 07:12
  • This is what i did to workaround my problem. It does not adhere to the main question but it worked for me. i created a folder in tomcat/webapps named mwp and added an index.html file to it with meta-refresh tag to point to the orignal context. – Adyz Feb 13 '14 at 07:27

1 Answers1

1

Your application will (on your application server, not talking about vhosts or mod_rewrite on apache) only respond to:

  1. The application name you have defined in your web.xml
  2. If there is no such configuration in your web.xml, it will respond to the name of the war-file. If for example your application is called myWebApplication.war, it will respond to /myWebApplication.
Kurt Du Bois
  • 7,112
  • 4
  • 22
  • 32
  • Yes you are right it responds to the myWebApplication.war and it has nothing to do with "context.xml". Is there any way that i can keep both names like my "war" name stays the same but i can also access it using "/mwp". The requirement is to make the name short but the original name should be the same like if i want to access it using "/myWebApplication" – Adyz Feb 12 '14 at 11:27