Peter,

In your web.xml, does your Struts ActionServlet have init params just like
this: (per your mesage below)

<init-param>
        <param-name>config</param-name>
        <param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
        <param-name>config/index</param-name>
        <param-value>/WEB-INF/index-config.xml</param-value>
</init-param>

If not, then how are you specifing your struts config .xml files to the
ActionServlet?
See manual page:
http://struts.apache.org/userGuide/configuration.html#module_config-inform_c
ontroller

Regards,
David

-----Original Message-----
From: Peter Werno [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 05, 2004 10:33 AM
To: [EMAIL PROTECTED]
Subject: global forwards in module config files


Hello,

I am just in the course of moving from 1.0.x to 1.2 and the new version
should make heavy use of the modules that came with 1.1.
Now here is my problem:

I want to store a global forward in any module's config file named
"moduleHome" where "module" would be replaced with the actual module name.

In the "main" app, I want to have an action "loadModule.do" that should be
told where to forward to via a parameter.

While this works well, as long as the global forwards are all in the
"main" config file, it fails as soon as I put them in the individual
module-config-files.
Is this a "known feature", or am I just doing something wrong?

This is how it works:

--------- struts-config.xml ----------

<struts-config>
    ...

    <global-forwards>
        <forward name="home" path="/index.jsp" redirect="false"/>
        <forward name="loginform" path="/login.jsp" redirect="false"/>
        <forward name="error500" path="/error/err500.jsp" redirect="false"/>
        <forward name="trylogin" path="/loginAction.do" redirect="false"/>
        <forward name="indexHome" contextRelative="true"
path="/index/index.do" redirect="true"/>
        .... more ....
    </global-forwards>
    ...
</struts-config>

--------- end ---------

this is how it does NOT work:

--------- struts-config.xml ----------

<struts-config>
    ...

    <global-forwards>
        <forward name="home" path="/index.jsp" redirect="false"/>
        <forward name="loginform" path="/login.jsp" redirect="false"/>
        <forward name="error500" path="/error/err500.jsp" redirect="false"/>
        <forward name="trylogin" path="/loginAction.do" redirect="false"/>
    </global-forwards>
    ...
</struts-config>

--------- index-config.xml ----------

<struts-config>
    ...
    <global-forwards>
        <forward name="indexHome" contextRelative="true" path="index.do"
redirect="true"/>
    </global-forwards>
    ...
</struts-config>

--------- end ---------

many thanks,

Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to