Hey, but "module a" didn't have a definition! instanceDefinitions_de.xml is the default definition that inserted by struts, if no definition.xml is configured!
The RequestProcessor should use the /WEB-INF/plugins/giro/tiles-defs.xml from "modul b". Because I've switched to module b with the switchAction. I don't understand how it should work. - Request from Module A arrives - The ActionServlet search the RequestProcessor for Module A - The ActionServlet calls the process Method of Modul A's RequestProcessor - the Modul A's RequestProcessor calls the switchAction - the switchAction change the ModuleConfig in the Request - The Modul A's RequestProcessor tries to processForwardConfig (But the foreward Page/Definition is an Page from Modul B!! ) - the Modul A's (Tiles)RequestProcessor calls the processTilesDefinition() Method. - the processTilesDefinition() Method tries to read it's tiles-defs.xml, but there is no tiles-defs.xml for Modul A! So in my Opinion it could not work? How should the TilesRequestProcessor know, that the switchAction was called? And his ModuleConfig now is the wrong one? I cannot find this logic. Thanks Fredy -----Ursprüngliche Nachricht----- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 10. März 2005 10:43 An: dev@struts.apache.org Betreff: RE: Problems with SwitchAction and Modules Hi You need to list the tiles definition files you use in module A, and very important -->> Add a unique ID for each tiles plugin definition. i.e "Modul A: <plug-in className="org.apache.struts.tiles.TilesPlugin" id="A" > <set-property property="definitions-config" value="/WEB-INF/instanceDefinitions_de.xml" /> <set-property property="moduleAware" value="true" /> </plug-in> Hermod -----Original Message----- From: Hauschel Fred [mailto:[EMAIL PROTECTED] Sent: Thursday, March 10, 2005 10:29 AM To: Struts Developers List Subject: AW: Problems with SwitchAction and Modules Hey, yes, each module has it's own tiles plugin definition in his struts-config. "Module B": <plug-in className="org.apache.struts.tiles.TilesPlugin" > <set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml, /WEB-INF/plugins/giro/tiles-defs.xml" /> <set-property property="moduleAware" value="true" /> </plug-in> "Modul A: <plug-in className="org.apache.struts.tiles.TilesPlugin" > </plug-in> Oh, i see that my colleague has extend the config from Modul B. The reason is we want to extend module b's definition form Base Definition. "Base": <plug-in className="org.apache.struts.tiles.TilesPlugin" > <!-- Path to XML definition file --> <set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml" /> <!-- Set Module-awareness to true --> <set-property property="moduleAware" value="true" /> </plug-in> Fredy -----Ursprüngliche Nachricht----- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 10. März 2005 10:23 An: dev@struts.apache.org Betreff: RE: Problems with SwitchAction and Modules Hi What I was looking for, is how you have defined your tiles plugin in the various struts-config-xxx files (1 for each module) Hermod -----Original Message----- From: Hauschel Fred [mailto:[EMAIL PROTECTED] Sent: Thursday, March 10, 2005 10:17 AM To: Struts Developers List Subject: AW: Problems with SwitchAction and Modules The Modules are registered in web.xml as init Param of the ActionServlet. <init-param> <param-name>config/plugins/giro</param-name> <param-value>/WEB-INF/plugins/giro/struts-config.xml</param-value> </init-param> And the "tiles-defs.xml" file is located in "/WEB-INF/plugins/giro/ tiles-defs.xml" Did you know where the logic is for switching the RequestProcessor? Each Module does have it's own RequestProcessor and this the getRequestProcessor() Method of ActionServlet is called befor the switchAction is called. So there is no way to change the RequestProcessor?!??! Fredy -----Ursprüngliche Nachricht----- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 10. März 2005 10:12 An: dev@struts.apache.org Betreff: RE: Problems with SwitchAction and Modules Hi I am using this with out any problems. How have you set up your Struts module definitions ? Hermod -----Original Message----- From: Hauschel Fred [mailto:[EMAIL PROTECTED] Sent: Thursday, March 10, 2005 10:08 AM To: dev@struts.apache.org Subject: Problems with SwitchAction and Modules Hey all, I call the switch action in "module a" and tell him to switch to "module b". The switch Action does it's work, but the TilesRequestProcessor's moduleConfig is still the moduleConfig from "module a" and so the definitionFactory says: 10.03.2005 09:58:03.112 DEBUG [I18nFactorySet.parseXmlFile (508)] Can't open file '/WEB-INF/instanceDefinitions_de.xml' That's right, the "module a" didn't have any tiles-def's. But "modul b" have some. Does anybody have any idea? And I think there is a bug in ModuleUtils $Revision: 1.9 $ : If the passed prefix is wrong so the line MessageResourcesConfig[] mrConfig = config.findMessageResourcesConfigs(); Will throw an NullPointer. Fredy public void selectModule( String prefix, HttpServletRequest request, ServletContext context) { // Expose the resources for this module Enumeration enumer = context.getAttributeNames(); while (enumer.hasMoreElements()) { String element = (String) enumer.nextElement(); System.out.println( element ); } ModuleConfig config = getModuleConfig(prefix, context); if (config != null) { request.setAttribute(Globals.MODULE_KEY, config); } else { request.removeAttribute(Globals.MODULE_KEY); } MessageResourcesConfig[] mrConfig = config.findMessageResourcesConfigs(); for(int i = 0; i < mrConfig.length; i++) { String key = mrConfig[i].getKey(); MessageResources resources = (MessageResources) context.getAttribute(key + prefix); if (resources != null) { request.setAttribute(key, resources); } else { request.removeAttribute(key); } } } * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]