marino      2004/04/14 13:08:29

  Modified:    src/java/org/apache/velocity/tools/struts StrutsUtils.java
                        TilesTool.java ValidatorTool.java
  Log:
  fixed for deprecated or removed methods in Struts and Commons Validator
  
  Revision  Changes    Path
  1.23      +3 -2      
jakarta-velocity-tools/src/java/org/apache/velocity/tools/struts/StrutsUtils.java
  
  Index: StrutsUtils.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-velocity-tools/src/java/org/apache/velocity/tools/struts/StrutsUtils.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- StrutsUtils.java  14 Mar 2004 17:21:10 -0000      1.22
  +++ StrutsUtils.java  14 Apr 2004 20:08:28 -0000      1.23
  @@ -32,6 +32,7 @@
   import org.apache.struts.config.ActionConfig;
   import org.apache.struts.util.MessageResources;
   import org.apache.struts.util.RequestUtils;
  +import org.apache.struts.taglib.TagUtils;
   import org.apache.struts.util.ModuleUtils;
   
   /**
  @@ -277,7 +278,7 @@
                   queryString = action.substring(question);
               }
   
  -            String actionMapping = RequestUtils.getActionMappingName(action);
  +            String actionMapping = 
TagUtils.getInstance().getActionMappingName(action);
   
               if (servletMapping.startsWith("*."))
               {
  
  
  
  1.13      +4 -4      
jakarta-velocity-tools/src/java/org/apache/velocity/tools/struts/TilesTool.java
  
  Index: TilesTool.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-velocity-tools/src/java/org/apache/velocity/tools/struts/TilesTool.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- TilesTool.java    12 Mar 2004 20:30:31 -0000      1.12
  +++ TilesTool.java    14 Apr 2004 20:08:28 -0000      1.13
  @@ -216,7 +216,7 @@
       }
   
       /**
  -     * Imports all attributes in the current tiles-context into the 
  +     * Imports all attributes in the current tiles-context into the
        * current velocity-context.
        *
        * <p>This is functionally equivalent to
  @@ -312,7 +312,7 @@
        * @return the fully processed attribute value as String.
        * @throws Exception - Throws by underlying nested call to 
processDefinitionName()
        */
  -    protected String processTypedAttribute(AttributeDefinition value) 
  +    protected String processTypedAttribute(AttributeDefinition value)
           throws Exception
       {
           if (value instanceof DirectStringAttribute)
  @@ -467,7 +467,7 @@
               /* Call controller if any */
               if (controller != null)
               {
  -                controller.perform(subCompContext,
  +                controller.execute(subCompContext,
                                      this.request,
                                      this.response,
                                      this.application);
  
  
  
  1.10      +9 -9      
jakarta-velocity-tools/src/java/org/apache/velocity/tools/struts/ValidatorTool.java
  
  Index: ValidatorTool.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-velocity-tools/src/java/org/apache/velocity/tools/struts/ValidatorTool.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ValidatorTool.java        18 Feb 2004 23:34:50 -0000      1.9
  +++ ValidatorTool.java        14 Apr 2004 20:08:28 -0000      1.10
  @@ -32,14 +32,14 @@
   import org.apache.commons.validator.Form;
   import org.apache.commons.validator.ValidatorAction;
   import org.apache.commons.validator.ValidatorResources;
  -import org.apache.commons.validator.ValidatorUtil;
  +import org.apache.commons.validator.util.ValidatorUtils;
   import org.apache.commons.validator.Var;
   
   import org.apache.struts.Globals;
   import org.apache.struts.config.ActionConfig;
   import org.apache.struts.config.ModuleConfig;
   import org.apache.struts.util.MessageResources;
  -import org.apache.struts.util.RequestUtils;
  +import org.apache.struts.util.ModuleUtils;
   import org.apache.struts.validator.Resources;
   import org.apache.struts.validator.ValidatorPlugIn;
   
  @@ -87,7 +87,7 @@
       /** A reference to the HttpSession. */
       protected HttpSession session;
   
  -    /** A reference to the HttpSession. */
  +    /** A reference to the ValidatorResources. */
       protected ValidatorResources resources;
   
   
  @@ -144,7 +144,7 @@
               this.formName = config.getAttribute();
           }
   
  -        ModuleConfig mconfig = RequestUtils.getModuleConfig(request, app);
  +        ModuleConfig mconfig = ModuleUtils.getInstance().getModuleConfig(request, 
app);
           this.resources = (ValidatorResources)app.getAttribute(ValidatorPlugIn.
                   VALIDATOR_KEY +
                   mconfig.getPrefix());
  @@ -370,7 +370,7 @@
   
           Locale locale = StrutsUtils.getLocale(request, session);
   
  -        Form form = resources.get(locale, formName);
  +        Form form = resources.getForm(locale, formName);
           if (form != null)
           {
               results.append(getDynamicJavascript(resources, locale, form));
  @@ -486,7 +486,7 @@
                       results.append(varName);
   
                       String escapedVarValue =
  -                        ValidatorUtil.replace(varValue, "\\", "\\\\");
  +                        ValidatorUtils.replace(varValue, "\\", "\\\\");
   
                       if (Var.JSTYPE_INT.equalsIgnoreCase(jsType))
                       {
  @@ -571,7 +571,7 @@
           for (Iterator i = form.getFields().iterator(); i.hasNext();)
           {
               Field field = (Field)i.next();
  -            for (Iterator x = field.getDependencies().iterator(); x.hasNext();)
  +            for (Iterator x = field.getDependencyList().iterator(); x.hasNext();)
               {
                   Object o = x.next();
                   if (o != null && !actionMethods.contains(o))
  @@ -860,7 +860,7 @@
               }
               else
               {
  -                return va1.getDependencies().size() - va2.getDependencies().size();
  +                return va1.getDependencyList().size() - 
va2.getDependencyList().size();
               }
           }
       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to