You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Alan Jacobs <al...@hospitalitaliano.org.ar> on 2005/10/06 17:25:36 UTC

NullPointerException at org.apache.struts.util.ModuleUtils.selectModule

 Hi guys, I'm having trouble trying to use different modules. Anyway, I
believe
 there's something weird in this method.
 As you can see, it first try to get the config for this module, then it
 removes an attribute from request if it is not found and the very next line
 uses the 'config' variable which happens to be null.
 Is it just a clean up before failing?

     public void selectModule(
         String prefix,
         HttpServletRequest request,
         ServletContext context) {

         // Expose the resources for this module
         ModuleConfig config = getModuleConfig(prefix, context);

         if (config != null) {
             request.setAttribute(Globals.MODULE_KEY, config);
         } else {
             request.removeAttribute(Globals.MODULE_KEY);
         }

         MessageResourcesConfig[] mrConfig =
 config.findMessageResourcesConfigs();
         ...
     }


Alan Jacobs
Desarrollo Sistemas Administrativos
Hospital Italiano de Buenos Aires
Argentina


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