users@glassfish.java.net

Problem with context-root in URL

From: <glassfish_at_javadesktop.org>
Date: Mon, 21 Jun 2010 00:59:18 PDT

Hi all.

I'm having some problems with the context-root. I have an EAR that contains a struts2 based WAR and some jars. On application.xml there is the following:

<application ...>
  <display-name>MyApplication</display-name>
  <module>
    <web>
      <web-uri>MyModule.war</web-uri>
      <context-root>/</context-root>
    </web>
  </module>
  <module>
    <java>javassist-3.9.0.GA.jar</java>
  </module>
  <module>
    <java>hsqldb-1.8.0.2.jar</java>
  </module>
</application>

First of all i had in the context-root "/MyMod" and i have defined in Glassfish Virtual Server that WAR as "Default Web Module", it's suposed that defining that removes the context-root from the URL., and the result was the context-root showing in the URL when the app does a struts redirect.
I changed the context-root to "/" both in application.xml and sun-web.xml and now I see in the URL the name of the WAR ("MyModule").

Is there a way of setting the context-root to / easily?

The server is Glassfish v2.1.1 ((v2.1 Patch06)(9.1_02 Patch12)) (build b31g-fcs) and I build both WAR and EAR from Eclipse.

Thanks in advance.
[Message sent by forum member 'kienvaser']

http://forums.java.net/jive/thread.jspa?messageID=475088