dgraham     2003/07/25 18:01:11

  Modified:    src/share/org/apache/struts/util RequestUtils.java
  Log:
  Deprecated getActionErrors().
  
  Revision  Changes    Path
  1.115     +8 -31     
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.114
  retrieving revision 1.115
  diff -u -r1.114 -r1.115
  --- RequestUtils.java 26 Jul 2003 00:34:24 -0000      1.114
  +++ RequestUtils.java 26 Jul 2003 01:01:11 -0000      1.115
  @@ -103,6 +103,7 @@
   import org.apache.struts.config.FormBeanConfig;
   import org.apache.struts.config.ForwardConfig;
   import org.apache.struts.config.ModuleConfig;
  +import org.apache.struts.taglib.TagUtils;
   import org.apache.struts.taglib.html.Constants;
   import org.apache.struts.upload.MultipartRequestHandler;
   import org.apache.struts.upload.MultipartRequestWrapper;
  @@ -1902,37 +1903,13 @@
        * @param paramName     Key for parameter value
        * @return ActionErrors from request scope
        * @exception JspException
  +     * @deprecated Use TagUtils.getActionErrors() instead.  This will be removed
  +     * after Struts 1.2.
        */
       public static ActionErrors getActionErrors(PageContext pageContext, String 
paramName)
           throws JspException {
   
  -        ActionErrors errors = new ActionErrors();
  -
  -        Object value = pageContext.findAttribute(paramName);
  -
  -        try {
  -            if (value == null) {
  -                ;
  -            } else if (value instanceof String) {
  -                errors.add(ActionErrors.GLOBAL_ERROR, new ActionError((String) 
value));
  -            } else if (value instanceof String[]) {
  -                String keys[] = (String[]) value;
  -                for (int i = 0; i < keys.length; i++) {
  -                    errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(keys[i]));
  -                }
  -            } else if (value instanceof ActionErrors) {
  -                errors = (ActionErrors) value;
  -            } else {
  -                throw new JspException(
  -                    messages.getMessage("actionErrors.errors", 
value.getClass().getName()));
  -            }
  -        } catch (JspException e) {
  -            throw e;
  -        } catch (Exception e) {
  -            log.debug(e, e);
  -        }
  -
  -        return errors;
  +        return TagUtils.getInstance().getActionErrors(pageContext, paramName);
       }
   
       /**
  
  
  

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

Reply via email to