war - Using the context-root from glassfish-web.xml in GlassFish 3 -
we switched glassfish 3.1.2.2 , have several web-applications packaged war files. @ times desired context-root these applications differs filename.
back when used weblogic achieved declaring context-root in weblogic.xml this
<context-root>path/to/our/app</context-root>
we noticed same tag exists in glassfish-web.xml. no matter define there, server determines filename context-root.
now find option --contextroot in asadmin utility allow overwrite filename @ deploy time, we'd prefer define directly in archive whoever deploy in end won't need know desired contex-root.
is there way achieve this?
normally should work glassfish-web.xml
looking this:
<!doctype glassfish-web-app public "-//glassfish.org//dtd glassfish application server 3.1 servlet 3.0//en" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd"> <glassfish-web-app> <context-root>/path/to/app</context-root> </glassfish-web-app>
but here looks need file called sun-web.xml
task.
here example:
<?xml version="1.0" encoding="utf-8"?> <!doctype sun-web-app public "-//sun microsystems, inc.//dtd glassfish application server 3.0 servlet 3.0//en" "http://www.sun.com/software/appserver/dtds/sun-web-app_3_0-0.dtd"> <sun-web-app error-url=""> <context-root>/path/to/our/app</context-root> </sun-web-app>