You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Milo Hyson <mi...@cyberlifelabs.com> on 2003/01/27 05:27:42 UTC
[PATCH] Re: JSP cannot call an action in its own module
David M. Karr wrote:
>>>>>>"Milo" == Milo Hyson <mi...@cyberlifelabs.com> writes:
>>>>>>
>>>>>>
>
> Milo> I've scanned the list here and found that many people seem to be having
> Milo> this same problem, so I'm going to add to it. I have a simple
> Milo> application with two modules, declared in the web.xml as follows:
>
> Milo> If I copy the action mapping into the default module
> Milo> (/WEB-INF/struts-config.xml), it works fine. No matter what value I
> Milo> enter into the html:form tag (including those beginning with trackers/),
> Milo> it always seems to look in the default module. I haven't looked at the
> Milo> source, but if I had to guess I'd say the JSP engine isn't aware of sub-modules.
>
>if you can't find any answer here, please submit a detailed bug report about
>this. It would be best if you could provide an isolated test case and put the
>entire build of it in a zip file, and attach it as an attachment to the bug
>report.
>
>If you want to do more analysis on this, try to execute your test case in a
>debugger and step through your action code, and the Struts framework code, to
>see if you can see where it is going wrong. If you see anything in that,
>detail that in your bug report.
>
>
>
I've reported this to Bugzilla and it has been assigned #16442. I've
also taken the liberty of solving the problem and developing a patch, as
follows:
--- RequestUtils.java.orig Sun Jan 26 14:09:31 2003
+++ RequestUtils.java Sun Jan 26 14:32:56 2003
@@ -1673,6 +1673,7 @@
* @since 1.1b3
*/
public static ModuleConfig getModuleConfig(PageContext pageContext) {
+
selectModule((HttpServletRequest)pageContext.getRequest(),pageContext.getServletContext());
ModuleConfig moduleConfig =
(ModuleConfig)
pageContext.getRequest().getAttribute(Globals.MODULE_KEY);
if (moduleConfig == null) { // Backwards compatibility hack
Apply this to src/share/org/apache/struts/util/RequestUtils.java and
recompile Struts to fix the issue.
- Milo Hyson
CyberLife Labs
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: JSP cannot call an action in its own module
Posted by Milo Hyson <mi...@cyberlifelabs.com>.
An FYI for all those who have written in with this problem. It seems
that the available documentation isn't clear enough with regards to JSPs
in multi-module applications. The Struts developers have confirmed that
all JSPs must be called from actions and not directly in order for the
ModuleConfig information to be present. I'll admit this is rather crude
and annoying, but that's the way it is.
- Milo Hyson
CyberLife Labs
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>