Problem with multiple modules configuration in Struts 1.1

Discussions

Web tier: servlets, JSP, Web frameworks: Problem with multiple modules configuration in Struts 1.1

  1. I have an application with Struts 1.1 and configured it as a module. The application works just fine.

    Next, I make a duplicate of the application and configured the duplicate as another module with a different name and directory. Theoretically, both modules should work, but then, only one of the modules worked and the other module did not.

    My configuration is below:

    <servlet>
    <servlet-name>strutdemo</servlet-name>
    <servlet-class>
       org.apache.struts.action.ActionServlet
    </servlet-class>
       <init-param>
          <param-name>config</param-name>
          <param-value>/WEB-INF/struts-config.xml</param-value>
          <param-name>config/strutdemo2</param-name>
          <param-value>
              /WEB-INF/struts-registration2-config.xml
          </param-value>
          <param-name>config/strutdemo</param-name>
          <param-value>
             /WEB-INF/struts-registration-config.xml
          </param-value>
       </init-param>
       <load-on-startup>1</load-on-startup>
    </servlet>

    I notice that it is only the last module in the listb worked correctly. I even swap the order around to confirm the behavior.

    Has anyone successfully more than one module to work in Struts 1.1. Your help is appreciated.
  2. This should help:

    <init-param>
          <param-name>config</param-name>
          <param-value>/WEB-INF/struts-config.xml</param-value>
    </init-param>
    <init-param>
          <param-name>config/strutdemo2</param-name>
          <param-value>
              /WEB-INF/struts-registration2-config.xml
          </param-value>
    </init-param>
    <init-param>
          <param-name>config/strutdemo</param-name>
          <param-value>
             /WEB-INF/struts-registration-config.xml
          </param-value>
    </init-param>

    --
    Andrew Kuzmin
    Java201.com
  3. Silly me for making such a mistake.

    Thanks for your help.