Re: [PATCH] Re: JSP cannot call an action in its own module
Attach all patches to the bugzilla report for the issue. Patches submitted to the mailing list have a high probability of getting lost. Thanks! From: Milo Hyson [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: [PATCH] Re: JSP cannot call an action in its own module Date: Sun, 26 Jan 2003 20:27:42 -0800 David M. Karr wrote: Milo == Milo Hyson [EMAIL PROTECTED] 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.origSun Jan 26 14:09:31 2003 +++ RequestUtils.javaSun 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: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: JSP cannot call an action in its own module
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: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: JSP cannot call an action in its own module
I thought not accessing JSPs directly was irritating at first too until I realized I was wrong :-). Hiding JSPs behind actions has too many advantages to not do it that way. What if you don't want to use JSPs in the future? How do you setup the data for the JSP to display? What if you want to change the layout of your JSPs without harming the user's bookmarks? What if you want to use Struts' modules ;-) ? David From: Milo Hyson [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: JSP cannot call an action in its own module Date: Mon, 27 Jan 2003 16:36:01 -0800 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: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
[PATCH] Re: JSP cannot call an action in its own module
David M. Karr wrote: Milo == Milo Hyson [EMAIL PROTECTED] 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.origSun Jan 26 14:09:31 2003 +++ RequestUtils.javaSun 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: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: JSP cannot call an action in its own module
Milo == Milo Hyson [EMAIL PROTECTED] 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. -- === David M. Karr ; Java/J2EE/XML/Unix/C++ [EMAIL PROTECTED] ; SCJP; SCWCD -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]