struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alan Jacobs" <alan.jac...@hospitalitaliano.org.ar>
Subject NullPointerException at org.apache.struts.util.ModuleUtils.selectModule
Date Thu, 06 Oct 2005 15:25:36 GMT
 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


Mime
View raw message