You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Brian Sayatovic/AMIG <BS...@amig.com> on 2005/11/15 00:48:03 UTC

Struts ModuleConfig when forwarding between modules

I ran into an instance where an Action in module A is forwarding to a page
that is designed for module B.  However, the resources that the page sees
are the resources from module A.

I'm using Struts 1.1.  I've goine through the source quite a bit.  It seems
the ModuleConfig and resources for a module are set when the ActionServlet
calls RequestUtils.selectModule(...).  This is fine for the action being
processed.  However, if I then forward to a page that's intended to work in
another module, it still finds the module information from the Action's
module in the request attributes.  I don't see anything else that calls
selectModule or otherwise sets up the info.

Is it not recommended to forward to pages built for other modules?  If so,
what is the work around?  I considered action chaining to an action in
module B, but I've been ridiculed for considering action chaining in the
past.

Any suggestions?

Regards,
Brian.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts ModuleConfig when forwarding between modules

Posted by Adam Hardy <ah...@cyberspaceroad.com>.
Brian Sayatovic/AMIG on 14/11/05 23:48, wrote:
> I ran into an instance where an Action in module A is forwarding to a page
> that is designed for module B.  However, the resources that the page sees
> are the resources from module A.
> 
> I'm using Struts 1.1.  I've goine through the source quite a bit.  It seems
> the ModuleConfig and resources for a module are set when the ActionServlet
> calls RequestUtils.selectModule(...).  This is fine for the action being
> processed.  However, if I then forward to a page that's intended to work in
> another module, it still finds the module information from the Action's
> module in the request attributes.  I don't see anything else that calls
> selectModule or otherwise sets up the info.
> 
> Is it not recommended to forward to pages built for other modules?  If so,
> what is the work around?  I considered action chaining to an action in
> module B, but I've been ridiculed for considering action chaining in the
> past.


Brian,
don't take it as ridicule but what are doing with your JSPs that make 
them module-aware? I don't think they are. Modularisation of struts 
concerns the configuration of multiple struts-config.xml, tiles-defs.xml 
and validation.xml files.

I am 90% sure that JSPs are blind to the module they are in. True, you 
can put them in a directory with the module name, but that has no effect.

What module info are you refering to?


Adam


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org