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: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>