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]

Reply via email to