Adyz
Adyz

Reputation: 302

Multiple context for java web application

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.

Upvotes: 1

Views: 1860

Answers (1)

Kurt Du Bois
Kurt Du Bois

Reputation: 7655

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.

Upvotes: 1

Related Questions