-
1. Re: defining the context path during deployment
ybxiang.china Sep 15, 2013 8:26 AM (in response to dstahl)I think you can do it in both application.xml(xxx.ear) and jboss-web.xml(xxx.war)
(a) application.xml (I tested it in my projects, it works well)
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:application="http://java.sun.com/xml/ns/javaee/application_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_6.xsd"
id="Application_ID" version="6">
<display-name>ybxiang-forum</display-name>
<module>
<ejb>ybxiang-forum-ejb.jar</ejb>
</module>
<module>
<web>
<web-uri>ybxiang-forum-war.war</web-uri>
<context-root>/</context-root>
</web>
</module>
</application>
(b) jboss-web.xml (NOT tested)
Although I does NOT test it, I think you can find answer from jboss-as-7.2.0.Final\docs\schema\jboss-web_7_1.xsd.
There is an element definition:
<xsd:element name="context-root" type="jboss:context-rootType" minOccurs="0" maxOccurs="1"/>
-
2. Re: defining the context path during deployment
ybxiang.china Sep 15, 2013 8:27 AM (in response to dstahl)Moreover, please read some files in jboss-as-7.2.0.Final\docs\schema if you meet similar questions.
-
3. Re: defining the context path during deployment
ctomc Sep 16, 2013 6:08 AM (in response to dstahl)also you can use system properties inside application.xml / web.xml / jboss-web.xml and parametrize context root also with that.
-
4. Re: defining the context path during deployment
ybxiang.china Sep 17, 2013 10:45 AM (in response to ctomc)How to parametrize? Would you please post some code here?
I am very interested in it.
-
5. Re: defining the context path during deployment
dstahl Sep 17, 2013 4:48 PM (in response to ybxiang.china)at first, thanks for you suggestions!
I guess I need to clarify a bit more, since adopting the application.xml or the jboss-web.xml does not sound like a solution for me.
I'm taking care about the operations of some applications. We get "ready to use" application packages (EAR or WAR) from our software supplier. this package cannot be changed for support reasons - otherwise we loose support.
but unfortunately we need to deploy this package with different contexts (because of the connecting systems in 3 staging environments) and therefore i would like to to deploy the same EAR/WAR package (whatever is defined in application.xml or jboss-web.xml) using my own defined context.
-
6. Re: defining the context path during deployment
jaikiran Sep 18, 2013 5:54 AM (in response to dstahl)I think this should be possible with "deployment overlay" feature in WildFly. I am not sure if there is some documentation for it though. I'll have to dig through some mails to confirm.
-
7. Re: defining the context path during deployment
jaikiran Sep 18, 2013 5:56 AM (in response to jaikiran)Found it https://docs.jboss.org/author/display/AS72/Deployment+Overlays
By the way, you haven't mentioned which JBoss AS version you are using.
-
8. Re: defining the context path during deployment
dstahl Sep 23, 2013 2:45 PM (in response to jaikiran)This sounds very interesting.
I'm using jboss-as-7.1.1.Final. Does the overlay - way also apply? I couldn't find it in the documentation
-
9. Re: defining the context path during deployment
jaikiran Sep 24, 2013 1:14 AM (in response to dstahl)It was done post 7.1.1.Final release. So no, it's not in 7.1.1.