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/taglib TagUtils.java
Date Sat, 02 Aug 2003 22:19:37 GMT
dgraham     2003/08/02 15:19:37

  Modified:    src/share/org/apache/struts/util ModuleUtils.java
                        RequestUtils.java
               src/share/org/apache/struts/tiles
                        TilesUtilStrutsModulesImpl.java
               src/share/org/apache/struts/taglib TagUtils.java
  Log:
  Renamed ModuleUtils.getRequestModuleConfig() to getModuleConfig() to match
  other method names.
  
  Revision  Changes    Path
  1.3       +17 -17    jakarta-struts/src/share/org/apache/struts/util/ModuleUtils.java
  
  Index: ModuleUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/util/ModuleUtils.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ModuleUtils.java	2 Aug 2003 21:04:42 -0000	1.2
  +++ ModuleUtils.java	2 Aug 2003 22:19:37 -0000	1.3
  @@ -110,6 +110,22 @@
       protected ModuleUtils() {
           super();
       }
  +    
  +    /**
  +     * Return the current ModuleConfig object stored in request, if it exists,
  +     * null otherwise.
  +     * This method can be used by plugin to retrieve the current module config
  +     * object. If no moduleConfig is found, this means that the request haven't
  +     * hit the server throught the struts servlet. The appropriate module config
  +     * can be set and found with
  +     * <code>{@link RequestUtils#selectModule(HttpServletRequest, ServletContext)}
</code>.
  +     * @param request The servlet request we are processing
  +     * @return the ModuleConfig object from request, or null if none is set in
  +     * the request.
  +     */
  +    public ModuleConfig getModuleConfig(HttpServletRequest request) {
  +        return (ModuleConfig) request.getAttribute(Globals.MODULE_KEY);
  +    }
   
       /**
        * Return the ModuleConfig object is it exists, null otherwise.
  @@ -121,7 +137,7 @@
           HttpServletRequest request,
           ServletContext context) {
   
  -        ModuleConfig moduleConfig = this.getRequestModuleConfig(request);
  +        ModuleConfig moduleConfig = this.getModuleConfig(request);
   
           if (moduleConfig == null) {
               moduleConfig = (ModuleConfig) context.getAttribute(Globals.MODULE_KEY);
  @@ -201,22 +217,6 @@
        */
       public String[] getModulePrefixes(ServletContext context) {
           return (String[]) context.getAttribute(Globals.MODULE_PREFIXES_KEY);
  -    }
  -
  -    /**
  -     * Return the current ModuleConfig object stored in request, if it exists,
  -     * null otherwise.
  -     * This method can be used by plugin to retrieve the current module config
  -     * object. If no moduleConfig is found, this means that the request haven't
  -     * hit the server throught the struts servlet. The appropriate module config
  -     * can be set and found with
  -     * <code>{@link RequestUtils#selectModule(HttpServletRequest, ServletContext)}
</code>.
  -     * @param request The servlet request we are processing
  -     * @return the ModuleConfig object from request, or null if none is set in
  -     * the request.
  -     */
  -    public ModuleConfig getRequestModuleConfig(HttpServletRequest request) {
  -        return (ModuleConfig) request.getAttribute(Globals.MODULE_KEY);
       }
   
       /**
  
  
  
  1.134     +9 -9      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.133
  retrieving revision 1.134
  diff -u -r1.133 -r1.134
  --- RequestUtils.java	2 Aug 2003 21:16:54 -0000	1.133
  +++ RequestUtils.java	2 Aug 2003 22:19:37 -0000	1.134
  @@ -900,7 +900,7 @@
           }
   
           ModuleConfig moduleConfig =
  -            ModuleUtils.getInstance().getRequestModuleConfig(request);
  +            ModuleUtils.getInstance().getModuleConfig(request);
               
           multipartClass = moduleConfig.getControllerConfig().getMultipartClass();
   
  @@ -1057,7 +1057,7 @@
               
           } else if (pattern.startsWith("*.")) {
               ModuleConfig appConfig =
  -                ModuleUtils.getInstance().getRequestModuleConfig(request);
  +                ModuleUtils.getInstance().getModuleConfig(request);
               sb.append(appConfig.getPrefix());
               sb.append(action.getPath());
               sb.append(pattern.substring(1));
  @@ -1127,7 +1127,7 @@
   
           // Calculate a context relative path for this ForwardConfig
           ModuleConfig moduleConfig =
  -            ModuleUtils.getInstance().getRequestModuleConfig(request);
  +            ModuleUtils.getInstance().getModuleConfig(request);
           String forwardPattern = moduleConfig.getControllerConfig().getForwardPattern();
           if (forwardPattern == null) {
               // Performance optimization for previous default behavior
  @@ -1331,11 +1331,11 @@
        * @return the ModuleConfig object from request, or null if none is set in
        * the request.
        * @since Struts 1.1
  -     * @deprecated Use ModuleUtils.getRequestModuleConfig() instead.  This will be
  +     * @deprecated Use ModuleUtils.getModuleConfig() instead.  This will be
        * removed after Struts 1.2.
        */
       public static ModuleConfig getRequestModuleConfig( HttpServletRequest request) {
  -        return ModuleUtils.getInstance().getRequestModuleConfig(request);
  +        return ModuleUtils.getInstance().getModuleConfig(request);
       }
   
       /**
  
  
  
  1.7       +5 -5      jakarta-struts/src/share/org/apache/struts/tiles/TilesUtilStrutsModulesImpl.java
  
  Index: TilesUtilStrutsModulesImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/tiles/TilesUtilStrutsModulesImpl.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TilesUtilStrutsModulesImpl.java	2 Aug 2003 21:16:54 -0000	1.6
  +++ TilesUtilStrutsModulesImpl.java	2 Aug 2003 22:19:37 -0000	1.7
  @@ -199,12 +199,12 @@
           ServletContext servletContext) {
   
           ModuleConfig moduleConfig =
  -            ModuleUtils.getInstance().getRequestModuleConfig(request);
  +            ModuleUtils.getInstance().getModuleConfig(request);
   
           if (moduleConfig == null) {
               // ModuleConfig not found in current request. Select it.
               ModuleUtils.getInstance().selectModule(request, servletContext);
  -            moduleConfig = ModuleUtils.getInstance().getRequestModuleConfig(request);
  +            moduleConfig = ModuleUtils.getInstance().getModuleConfig(request);
           }
   
           return moduleConfig;
  
  
  
  1.22      +6 -6      jakarta-struts/src/share/org/apache/struts/taglib/TagUtils.java
  
  Index: TagUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/TagUtils.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- TagUtils.java	2 Aug 2003 21:38:16 -0000	1.21
  +++ TagUtils.java	2 Aug 2003 22:19:37 -0000	1.22
  @@ -708,7 +708,7 @@
   
           HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
           StringBuffer value = new StringBuffer(request.getContextPath());
  -        ModuleConfig config = ModuleUtils.getInstance().getRequestModuleConfig(request);
  +        ModuleConfig config = ModuleUtils.getInstance().getModuleConfig(request);
           
           if (config != null) {
               value.append(config.getPrefix());
  @@ -1034,7 +1034,7 @@
       public String pageURL(HttpServletRequest request, String page) {
   
           StringBuffer sb = new StringBuffer();
  -        ModuleConfig moduleConfig = ModuleUtils.getInstance().getRequestModuleConfig(request);
  +        ModuleConfig moduleConfig = ModuleUtils.getInstance().getModuleConfig(request);
           String pagePattern = moduleConfig.getControllerConfig().getPagePattern();
           
           if (pagePattern == null) {
  
  
  

---------------------------------------------------------------------
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