3 Replies Latest reply: Oct 19, 2012 2:48 PM by Obed Murillo RSS

    How to set the context path to / instead of /store?

    Obed Murillo
      Hi All,

      I am trying to change the context path of my atg application to be / instead of /store

      I am using ATG10.0.2 and jboss-5.1.0.GA, I tried changing the following but did not worked.

      I changed the web.xml to be
      <context-param>
      <param-name>context-root</param-name>
      <param-value>/</param-value>
      </context-param>

      I created a jboss-web.xml with this code inside
      <?xml version="1.0" encoding="UTF-8"?>
      <jboss-web>
      <context-root>/</context-root>
      </jboss-web>

      I also tied the change at /META-INF/application.xml

      <web>
      <web-uri>bank-webapp.war</web-uri>
      <context-root>mymoney</context-root>
      </web>

      I read the above info at;:
      https://community.jboss.org/wiki/HowDoIOverrideTheWebContextRoot

      And I found this at the atg documentation

      I changed the MANIFEST.MF of my app to be

      ATG-Web-Module: j2ee-apps/store/store.war
      ATG-Context-Root: /

      But none of those options worked.

      I just want to accomplish the following:
      change from htttp://www.ocorpws.com/store to htttp://www.ocorpws.com/ (This an example is not the actual site)

      I will really appreciate your help.

      Regards,
      Obed
        • 1. Re: How to set the context path to / instead of /store?
          Nitin Khare
          What you have done for changing the context root to "/" is all fine but it is important to know that there is a ROOT.war in the deploy folder of JBoss which by default gets bound to "/" context. You must be getting the error message like "Web mapping already exists for deployment" when you would be starting your JBoss server after changing your context root to "/". So either you can completely remove the ROOT.war from the deploy folder or change the context-root of ROOT.war by updating its web.xml like:

          <web-app>
          <display-name>Welcome to JBoss</display-name>
          <description>
          Welcome to JBoss
          </description>
          *<context-param>*
          *<param-name>context-root</param-name>*
          *<param-value>/jboss-root</param-value>*
          *</context-param>*
          <servlet>
          <servlet-name>Status Servlet</servlet-name>
          <servlet-class>org.jboss.web.tomcat.service.StatusServlet</servlet-class>
          </servlet>
          ..
          ..
          </web-app>

          and also update the jboss-web.xml of ROOT.war:

          <jboss-web>
          <security-domain>java:/jaas/jmx-console</security-domain>
          *<context-root>/jboss-root</context-root>*
          </jboss-web>

          I hope this serves your purpose.

          There can be a workaround also by modifying the index.html of ROOT.war in the deploy folder of your server and redirect request to your web application using meta refresh like:
          <meta http-equiv="refresh" content="0;URL='/store'">
          • 2. Re: How to set the context path to / instead of /store?
            Obed Murillo
            Thank you Nitin,

            I will try it now, I will back with you as soon as I am done.

            Regards,
            Obed
            • 3. Re: How to set the context path to / instead of /store?
              Obed Murillo
              Hi Nitin,

              That worked, now I have to solve other problems, I have some static assets at Root.war folder.

              Regards,
              Obed