• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

change context-root in application.xml at runtime

 
khuong pham
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to change the context-root in application.xml (ear) at runtime?

I would like to change the context-root from i.e. /usr to /newusr without to recompile the ear file. The changes should be set inside my application or in another configuration file (outside the ear file). Right now I have to hardcode this:

META-INF/application.xml
...
<module>
<web>
<web-uri>usr.war</web-uri>
<context-root>/usr</context-root>
</web>
</module>
...

Thx in advance
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34071
331
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Khuong,
You wouldn't have to rebuild the whole ear. You would have to restart the ear though. This isn't something that can get picked up at runtime.
 
khuong pham
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok. What is the solution if I have 100 customers and each customers want their own context-root i.e.

company1 = /company1/index.jsp
company2 = /company3/index.jsp
company3 = /company3/index.jsp
...
...

Do I have to applied all 100 context-root inside the application.xml if they use the same ear file. Another solution is to make ant build a application.xml for each customers but it can be differcult to manage if you have over 100 costumers. The best way is that each costumers can change the context-path in a configuration file outside the application(ear) or inside the application(ear) dynamic i.e. from web-interface via the context-path /adm
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic