rleland     2002/11/09 08:30:03

  Modified:    src/share/org/apache/struts/action ActionServlet.java
                        PlugIn.java
               src/share/org/apache/struts/actions SwitchAction.java
               src/share/org/apache/struts/taglib/bean StrutsTag.java
               src/share/org/apache/struts/taglib/logic ForwardTag.java
               src/share/org/apache/struts/tiles
                        StrutsModulesTilesUtilImpl.java TilesPlugin.java
                        TilesRequestProcessor.java
               src/share/org/apache/struts/util RequestUtils.java
               src/share/org/apache/struts/validator ValidatorPlugIn.java
  Log:
  Bug 14054
  Test struts-validator & tiles-documentation apps
  under Tomcat 4.0.6
  
  Revision  Changes    Path
  1.128     +92 -35    
jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java
  
  Index: ActionServlet.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java,v
  retrieving revision 1.127
  retrieving revision 1.128
  diff -u -r1.127 -r1.128
  --- ActionServlet.java        9 Nov 2002 07:11:21 -0000       1.127
  +++ ActionServlet.java        9 Nov 2002 16:30:02 -0000       1.128
  @@ -102,6 +102,7 @@
   import org.apache.struts.config.MessageResourcesConfig;
   import org.apache.struts.config.PlugInConfig;
   import org.apache.struts.config.ModuleConfig;
  +import org.apache.struts.config.impl.ModuleConfigImpl;
   import org.apache.struts.util.GenericDataSource;
   import org.apache.struts.util.MessageResources;
   import org.apache.struts.util.MessageResourcesFactory;
  @@ -446,11 +447,11 @@
   
           // Initialize application modules as needed
           getServletContext().setAttribute(Action.ACTION_SERVLET_KEY, this);
  -        ApplicationConfig ac = initApplicationConfig("", config);
  -        initApplicationMessageResources(ac);
  -        initApplicationDataSources(ac);
  -        initApplicationPlugIns(ac);
  -        ac.freeze();
  +        ModuleConfig moduleConfig = initModuleConfig("", config);
  +        initApplicationMessageResources(moduleConfig);
  +        initApplicationDataSources(moduleConfig);
  +        initModulePlugIns(moduleConfig);
  +        moduleConfig.freeze();
           Enumeration names = getServletConfig().getInitParameterNames();
           while (names.hasMoreElements()) {
               String name = (String) names.nextElement();
  @@ -458,12 +459,12 @@
                   continue;
               }
               String prefix = name.substring(6);
  -            ac = initApplicationConfig
  +            moduleConfig = initApplicationConfig
                   (prefix, getServletConfig().getInitParameter(name));
  -            initApplicationMessageResources(ac);
  -            initApplicationDataSources(ac);
  -            initApplicationPlugIns(ac);
  -            ac.freeze();
  +            initApplicationMessageResources(moduleConfig);
  +            initApplicationDataSources(moduleConfig);
  +            initModulePlugIns(moduleConfig);
  +            moduleConfig.freeze();
           }
           destroyConfigDigester();
   
  @@ -684,8 +685,8 @@
           while (keys.hasNext()) {
               String name = (String) keys.next();
               Object value = getServletContext().getAttribute(name);
  -            if (value instanceof ApplicationConfig) {
  -                ApplicationConfig config = (ApplicationConfig) value;
  +            if (value instanceof ModuleConfig) {
  +                ModuleConfig config = (ModuleConfig) value;
                   try {
                       getRequestProcessor(config).destroy();
                   } catch (Throwable t) {
  @@ -759,19 +760,36 @@
   
   
       /**
  -     * Return the application configuration object for the currently selected
  +     * Return the module configuration object for the currently selected
        * application module.
        *
        * @param request The servlet request we are processing
        * @since Struts 1.1
  +     * @deprecated use {@link #getModuleConfig(HttpServletRequest)}
        */
       protected ApplicationConfig getApplicationConfig
           (HttpServletRequest request) {
  +        /* Since Struts 1.1 only has one implementation for
  +           ModuleConfig casting is safe here. Used only for
  +           transition purposes !
  +        */
  +        return new ApplicationConfig((ModuleConfigImpl)getModuleConfig(request));
  +    }
  +
  +    /**
  +     * Return the module configuration object for the currently selected
  +     * application module.
  +     *
  +     * @param request The servlet request we are processing
  +     * @since Struts 1.1
  +     */
  +    protected ModuleConfig getModuleConfig
  +        (HttpServletRequest request) {
   
  -        ApplicationConfig config = (ApplicationConfig)
  +        ModuleConfig config = (ModuleConfig)
               request.getAttribute(Globals.MODULE_KEY);
           if (config == null) {
  -            config = (ApplicationConfig)
  +            config = (ModuleConfig)
                   getServletContext().getAttribute(Globals.MODULE_KEY);
           }
           return (config);
  @@ -791,7 +809,7 @@
        * @since Struts 1.1
        */
       protected synchronized RequestProcessor
  -        getRequestProcessor(ApplicationConfig config) throws ServletException {
  +        getRequestProcessor(ModuleConfig config) throws ServletException {
   
           String key = Action.REQUEST_PROCESSOR_KEY + config.getPrefix();
           RequestProcessor processor = (RequestProcessor)
  @@ -822,10 +840,30 @@
        *  configuration resource
        *
        * @exception ServletException if initialization cannot be performed
  +     * @deprecated use {@link #initModuleConfig(String,String)}
        * @since Struts 1.1
        */
       protected ApplicationConfig initApplicationConfig
           (String prefix, String path) throws ServletException {
  +        /* Since Struts 1.1 only has one implementation for
  +           ModuleConfig casting is safe here. Used only for
  +           transition purposes !
  +        */
  +        return new 
ApplicationConfig((ModuleConfigImpl)initModuleConfig(prefix,path));
  +    }
  +    /**
  +     * <p>Initialize the application configuration information for the
  +     * specified application module.</p>
  +     *
  +     * @param prefix Application prefix for this application
  +     * @param path Context-relative resource path for this application's
  +     *  configuration resource
  +     *
  +     * @exception ServletException if initialization cannot be performed
  +     * @since Struts 1.1
  +     */
  +    protected ModuleConfig initModuleConfig
  +        (String prefix, String path) throws ServletException {
   
           if (log.isDebugEnabled()) {
               log.debug("Initializing application path '" + prefix +
  @@ -833,11 +871,12 @@
           }
   
           // Parse the application configuration for this module
  -        ApplicationConfig config = null;
  +        ModuleConfig config = null;
           InputStream input = null;
           String mapping = null;
           try {
  -            config = new ApplicationConfig(prefix);
  +            //@todo & FIXME replace with a FactoryMethod
  +            config = new ModuleConfigImpl(prefix);
   
               // Support for module-wide ActionMapping type override
               mapping = getServletConfig().getInitParameter("mapping");
  @@ -905,7 +944,7 @@
        * @since Struts 1.1
        */
       protected void initApplicationDataSources
  -        (ApplicationConfig config) throws ServletException {
  +        (ModuleConfig config) throws ServletException {
   
           if (log.isDebugEnabled()) {
               log.debug("Initializing module path '" + config.getPrefix() +
  @@ -955,6 +994,19 @@
   
   
       /**
  +     * <p>Initialize the plug ins for the specified module.</p>
  +     *
  +     * @param config ModuleConfig information for this module
  +     *
  +     * @exception ServletException if initialization cannot be performed
  +     * @deprecated use {@link #initModulePlugIns(ModuleConfig)}
  +     * @since Struts 1.1
  +     */
  +    protected void initApplicationPlugIns
  +        (ModuleConfig config) throws ServletException {
  +        initModulePlugIns(config);
  +    }
  +    /**
        * <p>Initialize the plug ins for the specified application module.</p>
        *
        * @param config ApplicationConfig information for this module
  @@ -962,8 +1014,8 @@
        * @exception ServletException if initialization cannot be performed
        * @since Struts 1.1
        */
  -    protected void initApplicationPlugIns
  -        (ApplicationConfig config) throws ServletException {
  +    protected void initModulePlugIns
  +        (ModuleConfig config) throws ServletException {
   
           if (log.isDebugEnabled()) {
               log.debug("Initializing module path '" + config.getPrefix() +
  @@ -986,7 +1038,12 @@
                       ((PlugInPatch)plugIns[i]).init(this, (ModuleConfig)config);
                   }
                   else  {
  -                    plugIns[i].init(this, config);
  +                    /* Since Struts 1.1 only has one implementation for
  +                       ModuleConfig casting is safe here. Used only for
  +                       transition purposes !
  +                    */
  +                    ApplicationConfig ac = new 
ApplicationConfig((ModuleConfigImpl)config);
  +                    plugIns[i].init(this, ac);
                   }
               } catch (ServletException e) {
                 // Lets propagate
  @@ -1013,7 +1070,7 @@
        * @since Struts 1.1
        */
       protected void initApplicationMessageResources
  -        (ApplicationConfig config) throws ServletException {
  +        (ModuleConfig config) throws ServletException {
   
           MessageResourcesConfig mrcs[] =
               config.findMessageResourcesConfigs();
  @@ -1292,8 +1349,8 @@
                              HttpServletResponse response)
           throws IOException, ServletException {
   
  -        RequestUtils.selectApplication(request, getServletContext());
  -        getRequestProcessor(getApplicationConfig(request)).process
  +        RequestUtils.selectModule(request, getServletContext());
  +        getRequestProcessor(getModuleConfig(request)).process
               (request, response);
   
       }
  @@ -1307,12 +1364,12 @@
        * controller configuration from servlet initialization parameters (as
        * were used in Struts 1.0).
        *
  -     * @param config The ApplicationConfig object for the default module
  +     * @param config The ModuleConfig object for the default module
        *
        * @since Struts 1.1
        * @deprecated Will be removed in a release after Struts 1.1.
        */
  -    private void defaultControllerConfig(ApplicationConfig config) {
  +    private void defaultControllerConfig(ModuleConfig config) {
   
           String value = null;
   
  @@ -1370,7 +1427,7 @@
        * @since Struts 1.1
        * @deprecated Will be removed in a release after Struts 1.1.
        */
  -    private void defaultFormBeansConfig(ApplicationConfig config) {
  +    private void defaultFormBeansConfig(ModuleConfig config) {
   
           FormBeanConfig fbcs[] = config.findFormBeanConfigs();
           ActionFormBeans afb = new ActionFormBeans();
  @@ -1395,7 +1452,7 @@
        * @since Struts 1.1
        * @deprecated Will be removed in a release after Struts 1.1.
        */
  -    private void defaultForwardsConfig(ApplicationConfig config) {
  +    private void defaultForwardsConfig(ModuleConfig config) {
   
           ForwardConfig fcs[] = config.findForwardConfigs();
           ActionForwards af = new ActionForwards();
  @@ -1420,7 +1477,7 @@
        * @since Struts 1.1
        * @deprecated Will be removed in a release after Struts 1.1.
        */
  -    private void defaultMappingsConfig(ApplicationConfig config) {
  +    private void defaultMappingsConfig(ModuleConfig config) {
   
           ActionConfig acs[] = config.findActionConfigs();
           ActionMappings am = new ActionMappings();
  @@ -1445,7 +1502,7 @@
        * @since Struts 1.1
        * @deprecated Will be removed in a release after Struts 1.1.
        */
  -    private void defaultMessageResourcesConfig(ApplicationConfig config) {
  +    private void defaultMessageResourcesConfig(ModuleConfig config) {
   
           String value = null;
   
  
  
  
  1.6       +5 -4      jakarta-struts/src/share/org/apache/struts/action/PlugIn.java
  
  Index: PlugIn.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/PlugIn.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- PlugIn.java       9 Jul 2002 23:57:05 -0000       1.5
  +++ PlugIn.java       9 Nov 2002 16:30:02 -0000       1.6
  @@ -108,6 +108,7 @@
        *
        * @exception ServletException if this <code>PlugIn</code> cannot
        *  be successfully initialized
  +     * @deprecated use {@link PlugInPatch#init)}
        */
       public void init(ActionServlet servlet, ApplicationConfig config)
           throws ServletException;
  
  
  
  1.8       +5 -5      
jakarta-struts/src/share/org/apache/struts/actions/SwitchAction.java
  
  Index: SwitchAction.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/actions/SwitchAction.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- SwitchAction.java 8 Nov 2002 05:39:24 -0000       1.7
  +++ SwitchAction.java 9 Nov 2002 16:30:02 -0000       1.8
  @@ -151,7 +151,7 @@
           }
   
           // Switch to the requested application module
  -        RequestUtils.selectApplication(prefix, request,
  +        RequestUtils.selectModule(prefix, request,
                                          getServlet().getServletContext());
           if (request.getAttribute(Globals.MODULE_KEY) == null) {
               String message = messages.getMessage("switch.prefix", prefix);
  
  
  
  1.13      +6 -7      
jakarta-struts/src/share/org/apache/struts/taglib/bean/StrutsTag.java
  
  Index: StrutsTag.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/bean/StrutsTag.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- StrutsTag.java    30 Oct 2002 02:30:51 -0000      1.12
  +++ StrutsTag.java    9 Nov 2002 16:30:02 -0000       1.13
  @@ -65,8 +65,7 @@
   
   import javax.servlet.jsp.JspException;
   import javax.servlet.jsp.tagext.TagSupport;
  -import org.apache.struts.action.Action;
  -import org.apache.struts.config.ApplicationConfig;
  +import org.apache.struts.config.ModuleConfig;
   import org.apache.struts.util.MessageResources;
   import org.apache.struts.util.RequestUtils;
   
  @@ -177,7 +176,7 @@
           }
   
           // Retrieve our application module configuration information
  -        ApplicationConfig config = RequestUtils.getModuleConfig(pageContext);
  +        ModuleConfig config = RequestUtils.getModuleConfig(pageContext);
   
           // Retrieve the requested object to be exposed
           Object object = null;
  
  
  
  1.12      +6 -7      
jakarta-struts/src/share/org/apache/struts/taglib/logic/ForwardTag.java
  
  Index: ForwardTag.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/logic/ForwardTag.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ForwardTag.java   30 Oct 2002 02:31:23 -0000      1.11
  +++ ForwardTag.java   9 Nov 2002 16:30:02 -0000       1.12
  @@ -67,9 +67,8 @@
   import javax.servlet.http.HttpServletResponse;
   import javax.servlet.jsp.JspException;
   import javax.servlet.jsp.tagext.TagSupport;
  -import org.apache.struts.action.Action;
   import org.apache.struts.action.ActionForward;
  -import org.apache.struts.config.ApplicationConfig;
  +import org.apache.struts.config.ModuleConfig;
   import org.apache.struts.util.MessageResources;
   import org.apache.struts.util.RequestUtils;
   
  @@ -136,7 +135,7 @@
   
        // Look up the desired ActionForward entry
        ActionForward forward = null;
  -        ApplicationConfig config = RequestUtils.getModuleConfig(pageContext);
  +        ModuleConfig config = RequestUtils.getModuleConfig(pageContext);
        if (config != null)
            forward = (ActionForward) config.findForwardConfig(name);
        if (forward == null) {
  
  
  
  1.3       +5 -5      
jakarta-struts/src/share/org/apache/struts/tiles/StrutsModulesTilesUtilImpl.java
  
  Index: StrutsModulesTilesUtilImpl.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/tiles/StrutsModulesTilesUtilImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- StrutsModulesTilesUtilImpl.java   9 Nov 2002 07:11:21 -0000       1.2
  +++ StrutsModulesTilesUtilImpl.java   9 Nov 2002 16:30:02 -0000       1.3
  @@ -183,7 +183,7 @@
     /**
      * Get the current ModuleConfig.
      * <br>
  -   * Lookup in the request, and do selectApplication if not found. The side effect
  +   * Lookup in the request, and do selectModule if not found. The side effect
      * is that the Application object is set in the request if it was not present.
      */
    protected ModuleConfig getModuleConfig(HttpServletRequest request, ServletContext 
servletContext)
  @@ -192,7 +192,7 @@
     if(moduleConfig==null)
       {
         // ModuleConfig not found in current request. Select it.
  -    RequestUtils.selectApplication(request, servletContext);
  +    RequestUtils.selectModule(request, servletContext);
       moduleConfig = RequestUtils.getModuleConfig( request, servletContext);
       }
   
  
  
  
  1.9       +4 -5      
jakarta-struts/src/share/org/apache/struts/tiles/TilesPlugin.java
  
  Index: TilesPlugin.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/tiles/TilesPlugin.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- TilesPlugin.java  9 Nov 2002 07:11:21 -0000       1.8
  +++ TilesPlugin.java  9 Nov 2002 16:30:02 -0000       1.9
  @@ -67,6 +67,7 @@
   import org.apache.struts.config.PlugInConfig;
   import org.apache.struts.config.ApplicationConfig;
   import org.apache.struts.config.ControllerConfig;
  +import org.apache.struts.config.ModuleConfig;
   import org.apache.struts.action.ActionServlet;
   import org.apache.struts.action.RequestProcessor;
   import org.apache.struts.action.PlugInPatch;
  @@ -78,8 +79,6 @@
   
   import javax.servlet.ServletException;
   import javax.servlet.UnavailableException;
  -import org.apache.struts.config.ApplicationConfig;
  -import org.apache.struts.config.ModuleConfig;
   
   
   /**
  
  
  
  1.12      +4 -4      
jakarta-struts/src/share/org/apache/struts/tiles/TilesRequestProcessor.java
  
  Index: TilesRequestProcessor.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/tiles/TilesRequestProcessor.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- TilesRequestProcessor.java        8 Nov 2002 05:39:24 -0000       1.11
  +++ TilesRequestProcessor.java        9 Nov 2002 16:30:02 -0000       1.12
  @@ -109,7 +109,7 @@
        * @param servlet The ActionServlet we are associated with
        * @param appConfig The ApplicationConfig we are associated with.
        * @throws ServletException If an error occur during initialization
  -     * @deprecated   use init(ActionServlet, ModuleConfig)
  +     * @deprecated   use {@link #init(ActionServlet, ModuleConfig) }
        */
       public void init(ActionServlet servlet, ApplicationConfig appConfig)
         throws ServletException
  
  
  
  1.70      +67 -39    
jakarta-struts/src/share/org/apache/struts/util/RequestUtils.java
  
  Index: RequestUtils.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/util/RequestUtils.java,v
  retrieving revision 1.69
  retrieving revision 1.70
  diff -u -r1.69 -r1.70
  --- RequestUtils.java 8 Nov 2002 05:39:24 -0000       1.69
  +++ RequestUtils.java 9 Nov 2002 16:30:02 -0000       1.70
  @@ -98,7 +98,6 @@
   import org.apache.struts.action.DynaActionFormClass;
   import org.apache.struts.action.RequestProcessor;
   import org.apache.struts.config.ActionConfig;
  -import org.apache.struts.config.ApplicationConfig;
   import org.apache.struts.config.FormBeanConfig;
   import org.apache.struts.config.ForwardConfig;
   import org.apache.struts.config.ModuleConfig;
  @@ -388,11 +387,11 @@
                   (messages.getMessage("computeURL.specifier"));
           }
   
  -        // Look up the application module configuration for this request
  -        ApplicationConfig config = (ApplicationConfig)
  +        // Look up the module configuration for this request
  +        ModuleConfig config = (ModuleConfig)
               pageContext.getRequest().getAttribute(Globals.MODULE_KEY);
           if (config == null) { // Backwards compatibility hack
  -            config = (ApplicationConfig)
  +            config = (ModuleConfig)
                   pageContext.getServletContext().getAttribute
                   (Globals.MODULE_KEY);
               pageContext.getRequest().setAttribute(Globals.MODULE_KEY,
  @@ -538,7 +537,7 @@
        *
        * @param request The servlet request we are processing
        * @param mapping The action mapping for this request
  -     * @param moduleConfig The application configuration for this module
  +     * @param moduleConfig The configuration for this module
        * @param servlet The action servlet
        * @return ActionForm instance associated with this request
        */
  @@ -1043,9 +1042,9 @@
                   return multipartHandler;
           }
   
  -        ApplicationConfig appConfig = (ApplicationConfig)
  +        ModuleConfig moduleConfig = (ModuleConfig)
               request.getAttribute(Globals.MODULE_KEY);
  -        multipartClass = appConfig.getControllerConfig().getMultipartClass();
  +        multipartClass = moduleConfig.getControllerConfig().getMultipartClass();
   
           // Try to initialize the global request handler
           if (multipartClass != null) {
  @@ -1160,13 +1159,13 @@
   
       /**
        * Return the context-relative URL that corresponds to the specified
  -     * {@link ActionConfig}, relative to the application module associated
  -     * with the current modules's {@link ApplicationConfig}.
  +     * {@link ActionConfig}, relative to the module associated
  +     * with the current modules's {@link ModuleConfig}.
        *
        * @param request The servlet request we are processing
        * @param action ActionConfig to be evaluated
        * @param pattern URL pattern used to map the controller servlet
  -     * @return  context-relative URL relative to the application module
  +     * @return  context-relative URL relative to the module
        *
        * @since Struts 1.1b2
        */
  @@ -1179,7 +1178,7 @@
               sb.append(pattern.substring(0, pattern.length() - 2));
               sb.append(action.getPath());
           } else if (pattern.startsWith("*.")) {
  -            ApplicationConfig appConfig = (ApplicationConfig)
  +            ModuleConfig appConfig = (ModuleConfig)
                   request.getAttribute(Globals.MODULE_KEY);
               sb.append(appConfig.getPrefix());
               sb.append(action.getPath());
  @@ -1194,7 +1193,7 @@
       /**
        * Return the context-relative URL that corresponds to the specified
        * {@link ForwardConfig}, relative to the module associated
  -     * with the current {@link ApplicationConfig}. The forward path is
  +     * with the current {@link ModuleConfig}. The forward path is
        * gracefully prefixed with a '/' according to the boolean
        *
        *
  @@ -1219,7 +1218,7 @@
           }
   
           // Calculate a context relative path for this ForwardConfig
  -        ApplicationConfig appConfig = (ApplicationConfig)
  +        ModuleConfig appConfig = (ModuleConfig)
               request.getAttribute(Globals.MODULE_KEY);
           String forwardPattern =
               appConfig.getControllerConfig().getForwardPattern();
  @@ -1271,7 +1270,7 @@
        * Return the context-relative URL that corresponds to the specified
        * <code>page</code> attribute value, calculated based on the
        * <code>pagePattern</code> property of the current module's
  -     * {@link ApplicationConfig}.
  +     * {@link ModuleConfig}.
        *
        * @param request The servlet request we are processing
        * @param page The module-relative URL to be substituted in
  @@ -1283,7 +1282,7 @@
                                    String page) {
   
           StringBuffer sb = new StringBuffer();
  -        ApplicationConfig appConfig = (ApplicationConfig)
  +        ModuleConfig appConfig = (ModuleConfig)
               request.getAttribute(Globals.MODULE_KEY);
           String pagePattern =
               appConfig.getControllerConfig().getPagePattern();
  @@ -1399,19 +1398,35 @@
   
   
       /**
  -     * Select the application module to which the specified request belongs, and
  +     * Select the module to which the specified request belongs, and
        * add corresponding request attributes to this request.
        *
  -     * @param prefix The module prefix of the desired application module
  +     * @param prefix The module prefix of the desired module
        * @param request The servlet request we are processing
        * @param context The ServletContext for this web application
  +     * @deprecated use {@link 
#selectModule(String,HttpServletRequest,ServletContext)}
        */
       public static void selectApplication(String prefix,
                                            HttpServletRequest request,
                                            ServletContext context) {
  +        selectModule(prefix,request,context);
  +    }
  +
  +    /**
  +     * Select the module to which the specified request belongs, and
  +     * add corresponding request attributes to this request.
  +     *
  +     * @param prefix The module prefix of the desired module
  +     * @param request The servlet request we are processing
  +     * @param context The ServletContext for this web application
  +     * @since struts 1.1b3
  +     */
  +    public static void selectModule(String prefix,
  +                                         HttpServletRequest request,
  +                                         ServletContext context) {
   
  -        // Expose the resources for this application module
  -        ApplicationConfig config = (ApplicationConfig)
  +        // Expose the resources for this module
  +        ModuleConfig config = (ModuleConfig)
               context.getAttribute(Globals.MODULE_KEY + prefix);
           if (config != null) {
               request.setAttribute(Globals.MODULE_KEY, config);
  @@ -1435,13 +1450,26 @@
        *
        * @param request The servlet request we are processing
        * @param context The ServletContext for this web application
  +     * @deprecated use {@link #selectModule(HttpServletRequest,ServletContext)}
        */
       public static void selectApplication(HttpServletRequest request,
                                            ServletContext context) {
  +        selectModule(request, context);
  +    }
  +
  +    /**
  +     * Select the module to which the specified request belongs, and
  +     * add corresponding request attributes to this request.
  +     *
  +     * @param request The servlet request we are processing
  +     * @param context The ServletContext for this web application
  +     */
  +    public static void selectModule(HttpServletRequest request,
  +                                         ServletContext context) {
             // Compute module name
           String prefix = getModuleName( request, context);
           // Expose the resources for this module
  -        selectApplication(prefix, request, context);
  +        selectModule(prefix, request, context);
   
       }
   
  @@ -1496,36 +1524,36 @@
   
   
       /**
  -     * Return the ApplicationConfig object is it exists, null otherwise.
  +     * Return the ModuleConfig object is it exists, null otherwise.
        * @param pageContext The page context.
  -     * @return the ApplicationConfig object
  +     * @return the ModuleConfig object
        * @since 1.1b3
        */
  -    public static ApplicationConfig getModuleConfig(PageContext pageContext) {
  -       ApplicationConfig appConfig = (ApplicationConfig)
  +    public static ModuleConfig getModuleConfig(PageContext pageContext) {
  +       ModuleConfig moduleConfig = (ModuleConfig)
              pageContext.getRequest().getAttribute(Globals.MODULE_KEY);
  -       if (appConfig == null) { // Backwards compatibility hack
  -           appConfig = (ApplicationConfig)
  +       if (moduleConfig == null) { // Backwards compatibility hack
  +           moduleConfig = (ModuleConfig)
                  pageContext.getServletContext().getAttribute(Globals.MODULE_KEY);
          }
  -       return appConfig;
  +       return moduleConfig;
       }
   
       /**
  -     * Return the ApplicationConfig object is it exists, null otherwise.
  +     * Return the ModuleConfig object is it exists, null otherwise.
        * @param request The servlet request we are processing
        * @param context The ServletContext for this web application
  -     * @return the ApplicationConfig object
  +     * @return the ModuleConfig object
        * @since 1.1b3
        */
  -    public static ApplicationConfig getModuleConfig(HttpServletRequest 
request,ServletContext context) {
  -        ApplicationConfig appConfig = (ApplicationConfig)
  +    public static ModuleConfig getModuleConfig(HttpServletRequest 
request,ServletContext context) {
  +        ModuleConfig moduleConfig = (ModuleConfig)
               request.getAttribute(Globals.MODULE_KEY);
  -        if (appConfig == null) {
  -            appConfig = (ApplicationConfig)
  +        if (moduleConfig == null) {
  +            moduleConfig = (ModuleConfig)
                   context.getAttribute(Globals.MODULE_KEY);
           }
  -       return appConfig;
  +       return moduleConfig;
       }
   
       /**
  @@ -1654,7 +1682,7 @@
           } catch (JspException e) {
               throw e;
           } catch (Exception e) {
  -            LOG.debug(e);
  +            LOG.debug(e,e);
           }
   
           return errors;
  
  
  
  1.13      +5 -4      
jakarta-struts/src/share/org/apache/struts/validator/ValidatorPlugIn.java
  
  Index: ValidatorPlugIn.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/validator/ValidatorPlugIn.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- ValidatorPlugIn.java      9 Nov 2002 07:11:21 -0000       1.12
  +++ ValidatorPlugIn.java      9 Nov 2002 16:30:02 -0000       1.13
  @@ -154,6 +154,7 @@
        * @param config The ApplicationConfig for our owning module
        *
        * @exception ServletException if we cannot configure ourselves correctly
  +     * @deprecated use {@link #init(ActionServlet,ModuleConfig)}
        */
       public void init(ActionServlet servlet, ApplicationConfig config)
                            throws ServletException {
  
  
  

--
To unsubscribe, e-mail:   <mailto:struts-dev-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-dev-help@;jakarta.apache.org>

Reply via email to