简体   繁体   English

Java Web应用程序的多个上下文

[英]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 我这里的情况是我在jsf-2.1中有一个应用程序,它部署为http://localhost:8080/myWebApplication ,在“ META-INF”中,我有context.xml,它具有以下配置

<?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' 现在我想缩短名称而不丢失context =>'myWebApplication'像'/ 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. 请告知是否有可能或有任何解决方法来实现此目的。

Your application will (on your application server, not talking about vhosts or mod_rewrite on apache) only respond to: 您的应用程序将(仅在应用程序服务器上,不谈论虚拟主机或Apache上的mod_rewrite)仅响应:

  1. The application name you have defined in your web.xml 您在web.xml中定义的应用程序名称
  2. If there is no such configuration in your web.xml, it will respond to the name of the war-file. 如果您的web.xml中没有这样的配置,它将响应war文件的名称。 If for example your application is called myWebApplication.war, it will respond to /myWebApplication. 例如,如果您的应用程序名为myWebApplication.war,它将响应/ myWebApplication。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM