struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas CORNET <tho...@cornet.name>
Subject Re: Multiple application support
Date Fri, 07 Mar 2003 09:34:12 GMT

Had the same problem.. You need to pass through the struts controller to 
use the modules, because this is the controller which is able to determine 
in which module you are. So you need to browse the result of an action to 
use modules. Just create an action without form in your 
struts-config-common.xml such as :

         <action path="/index" type="package.IndexAction" validate="false">
             <forward name="ok" path="/index.jsp" />

With a void action such as

         public ActionForward execute(
                 ActionMapping mapping,
                 ActionForm form,
                 HttpServletRequest request,
                 HttpServletResponse response)
                 throws Exception
         {
                 return mapping.findForward("ok");
         }


And try to test 'http://localhost/app/common/index.do' instead of 
'http://localhost/app/common/index.jsp', this should work well :)

      Thomas


At 09:42 07/03/2003, you wrote:
>Hi
>
>I have some problems with struts multiple application support. I have 
>build a second struts-config.xml called common-struts-config.xml and I 
>have registered it in the web.xml.
>
>   <servlet>
>     <servlet-name>action</servlet-name>
>     <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
>       <init-param>
>         <param-name>config</param-name>
>         <param-value>/WEB-INF/struts-config.xml</param-value>
>       </init-param>
>       <init-param>
>         <param-name>config/common</param-name>
>         <param-value>/WEB-INF/struts-config-common.xml</param-value>
>       </init-param>
>     <init-param>
>       <param-name>debug</param-name>
>       <param-value>4</param-value>
>     </init-param>
>     <init-param>
>       <param-name>detail</param-name>
>       <param-value>4</param-value>
>     </init-param>
>     <load-on-startup>2</load-on-startup>
>   </servlet>
>
>In my Index.jsp I have the folloging tag:
>
>and I get an exception. I have debuged struts and I might have found the 
>problem in the html:form tag but in the requestUtils. In FormTag.java line 
>713: moduleConfig = RequestUtils.getModuleConfig(pageContext); And the 
>procedure in RequestUtils: public static ModuleConfig 
>getModuleConfig(PageContext pageContext) { ModuleConfig moduleConfig = 
>(ModuleConfig) pageContext.getRequest().getAttribute(Globals.MODULE_KEY); 
>if (moduleConfig == null) { // Backwards compatibility hack moduleConfig = 
>(ModuleConfig) 
>pageContext.getServletContext().getAttribute(Globals.MODULE_KEY); } return 
>moduleConfig; } It searches only in the default module and not in the 
>several modul-configuration. So I think here is one problem. Just my 
>question: Has anyone have succeed with multiple struts-config-modules. 
>Perhaps I make a mistake. Manfred 
>--------------------------------------------------------------------- To 
>unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org For 
>additional commands, e-mail: struts-user-help@jakarta.apache.org


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


Mime
View raw message