You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Martin Cooper <ma...@tumbleweed.com> on 2002/03/02 06:43:34 UTC

Re: [Struts-Dev] Multi-App support and frames / iframes

This issue is the reason that Craig mentioned, in the original "The BIG
Check-In" message, that all requests must flow through the controller. See:

http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg04354.html

Look for the WARNING about half way down the message.

I assume your second solution is intended to avoid the need to define
individual ForwardAction mappings for each JSP in your application, while
ensuring that Struts does its controller thing before your JSP is invoked.
You would still have to define one of these mappings for each module
(sub-app) in your application, though, so that Struts sets up the correct
context.

I don't have a strong feeling one way or another on this, but if you want to
enter an enhancement request in bugzilla, that will ensure that we don't
lose track of the idea. Code would be even better. ;-) However, I'm not sure
that this would be an enhancement of ForwardAction. It seems like a
different action, to me.

--
Martin Cooper


----- Original Message -----
From: "Laine Donlan (DEV)" <la...@hotmail.com>
To: <st...@jakarta.apache.org>
Sent: Thursday, February 28, 2002 11:09 AM
Subject: [Struts-Dev] Multi-App support and frames / iframes


> I have been experimenting with the multi application support in the latest
> nightly builds, and it is real nice - a much needed feature, thanks.  I
had
> a question about how to handle applications and sub applications that make
a
> lot of use of frames or iframes.  I am pretty sure that this relates only
to
> message resources, but I guess it might also apply to the <struts> tag as
> well.
>
> Basically the problem I was seeing that when an action was processed and
the
> subsequent view contains multiple frames - when those JSPs were requested
> and processed the message resources are no longer mapped to the proper sub
> application.  This is due to the fact that in lines 1170 - 1178 of the
> RequestUtils:
>
> // Expose the resources for this sub-application
>         ApplicationConfig config = (ApplicationConfig)
>             context.getAttribute(Action.APPLICATION_KEY + prefix);
>         if (config != null)
>             request.setAttribute(Action.APPLICATION_KEY, config);
>         MessageResources resources = (MessageResources)
>             context.getAttribute(Action.MESSAGES_KEY + prefix);
>         if (resources != null)
>             request.setAttribute(Action.MESSAGES_KEY, resources);
>
> The app config and resources are stored in the request (which is not
> available to the jsps residing in the frames).  There are two possible
> solutions that I can see, allow each sub application to determine how it
> should be stored - request, session, etc, but I think has more downstream
> affects on how actions are processed.  The other solution would be to
> provide a way to map a JSP request through the sub application via a
forward
> action.  An easy modification to the ForwardAction to use a request
> parameter (forward.uri) if no 'parameter' is defined in the mapping, would
> allow JSP requests to be mapped through an action and therefore be
> configured properly.
>
> I think both solutions have upsides and downsides.  Would be interested in
> comments from the group.  I have code to handle both that I can submit
> depending on which way is preferred.
>
> Thanks
>
> Laine
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>