struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dgra...@apache.org
Subject cvs commit: jakarta-struts/src/share/org/apache/struts/action Action.java
Date Sat, 02 Aug 2003 21:12:16 GMT
dgraham     2003/08/02 14:12:16

  Modified:    src/share/org/apache/struts/validator Resources.java
               src/share/org/apache/struts/action Action.java
  Log:
  Replace RequestUtils calls with ModuleUtils.
  
  Revision  Changes    Path
  1.19      +9 -5      jakarta-struts/src/share/org/apache/struts/validator/Resources.java
  
  Index: Resources.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/validator/Resources.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- Resources.java	26 Jul 2003 00:40:29 -0000	1.18
  +++ Resources.java	2 Aug 2003 21:12:16 -0000	1.19
  @@ -74,6 +74,7 @@
   import org.apache.struts.action.ActionError;
   import org.apache.struts.action.ActionErrors;
   import org.apache.struts.util.MessageResources;
  +import org.apache.struts.util.ModuleUtils;
   import org.apache.struts.util.RequestUtils;
   
   /**
  @@ -132,7 +133,10 @@
           HttpServletRequest request) {
               
           String prefix =
  -            RequestUtils.getModuleConfig(request, application).getPrefix();
  +            ModuleUtils
  +                .getInstance()
  +                .getModuleConfig(request, application)
  +                .getPrefix();
               
           return (ValidatorResources) application.getAttribute(
               ValidatorPlugIn.VALIDATOR_KEY + prefix);
  
  
  
  1.66      +15 -13    jakarta-struts/src/share/org/apache/struts/action/Action.java
  
  Index: Action.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/Action.java,v
  retrieving revision 1.65
  retrieving revision 1.66
  diff -u -r1.65 -r1.66
  --- Action.java	26 Jul 2003 00:30:43 -0000	1.65
  +++ Action.java	2 Aug 2003 21:12:16 -0000	1.66
  @@ -74,6 +74,7 @@
   import org.apache.struts.Globals;
   import org.apache.struts.config.ModuleConfig;
   import org.apache.struts.util.MessageResources;
  +import org.apache.struts.util.ModuleUtils;
   import org.apache.struts.util.RequestUtils;
   import org.apache.struts.util.TokenProcessor;
   
  @@ -281,11 +282,10 @@
   
           // Identify the current module
           ServletContext context = getServlet().getServletContext();
  -        ModuleConfig moduleConfig = RequestUtils.getModuleConfig(request,context);
  -
  -        // Return the requested data source instance
  -        return ((DataSource) context.getAttribute(key + moduleConfig.getPrefix()));
  +        ModuleConfig moduleConfig =
  +            ModuleUtils.getInstance().getModuleConfig(request, context);
   
  +        return (DataSource) context.getAttribute(key + moduleConfig.getPrefix());
       }
   
   
  @@ -320,16 +320,18 @@
        *
        * @since Struts 1.1
        */
  -    protected MessageResources getResources(HttpServletRequest request,
  -                                            String key) {
  +    protected MessageResources getResources(
  +        HttpServletRequest request,
  +        String key) {
   
           // Identify the current module
           ServletContext context = getServlet().getServletContext();
  -        ModuleConfig moduleConfig = RequestUtils.getModuleConfig(request,context);
  +        ModuleConfig moduleConfig =
  +            ModuleUtils.getInstance().getModuleConfig(request, context);
   
           // Return the requested message resources instance
  -        return ((MessageResources) context.getAttribute
  -                (key + moduleConfig.getPrefix()));
  +        return (MessageResources) context.getAttribute(
  +            key + moduleConfig.getPrefix());
   
       }
   
  
  
  

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


Mime
View raw message