You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by rl...@apache.org on 2003/07/26 19:22:28 UTC

cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/logic CompareTagBase.java EmptyTag.java IterateTag.java MatchTag.java PresentTag.java

rleland     2003/07/26 10:22:28

  Modified:    src/share/org/apache/struts/taglib TagUtils.java
               src/share/org/apache/struts/taglib/bean DefineTag.java
                        MessageTag.java SizeTag.java WriteTag.java
               src/share/org/apache/struts/taglib/html BaseFieldTag.java
                        BaseHandlerTag.java CheckboxTag.java HiddenTag.java
                        ImgTag.java MultiboxTag.java
                        OptionsCollectionTag.java OptionsTag.java
                        SelectTag.java
               src/share/org/apache/struts/taglib/logic CompareTagBase.java
                        EmptyTag.java IterateTag.java MatchTag.java
                        PresentTag.java
  Log:
  Make tags use new Tagutil.lookup() methods
  
  Revision  Changes    Path
  1.6       +118 -4    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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TagUtils.java	26 Jul 2003 01:22:31 -0000	1.5
  +++ TagUtils.java	26 Jul 2003 17:22:27 -0000	1.6
  @@ -64,6 +64,7 @@
   import java.util.HashMap;
   import java.util.Locale;
   import java.util.Map;
  +import java.lang.reflect.InvocationTargetException;
   
   import javax.servlet.http.HttpServletRequest;
   import javax.servlet.jsp.JspException;
  @@ -71,11 +72,13 @@
   
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  +import org.apache.commons.beanutils.PropertyUtils;
   import org.apache.struts.action.ActionError;
   import org.apache.struts.action.ActionErrors;
   import org.apache.struts.config.ModuleConfig;
   import org.apache.struts.util.MessageResources;
   import org.apache.struts.util.RequestUtils;
  +import org.apache.struts.Globals;
   
   /**
    * Provides helper methods for JSP tags.
  @@ -226,6 +229,117 @@
           return RequestUtils.getUserLocale(
               (HttpServletRequest) pageContext.getRequest(),
               locale);
  +    }
  +
  +    /**
  +     * Locate and return the specified bean, from an optionally specified
  +     * scope, in the specified page context.  If no such bean is found,
  +     * return <code>null</code> instead.  If an exception is thrown, it will
  +     * have already been saved via a call to <code>saveException()</code>.
  +     *
  +     * @param pageContext Page context to be searched
  +     * @param name Name of the bean to be retrieved
  +     * @param scopeName Scope to be searched (page, request, session, application)
  +     *  or <code>null</code> to use <code>findAttribute()</code> instead
  +     * @return JavaBean in the specified page context
  +     * @exception JspException if an invalid scope name
  +     *  is requested
  +     */
  +    public static Object lookup(PageContext pageContext, String name, String scopeName)
  +        throws JspException {
  +
  +        if (scopeName == null) {
  +            return pageContext.findAttribute(name);
  +        }
  +
  +        try {
  +            return pageContext.getAttribute(name, instance.getScope(scopeName));
  +
  +        } catch (JspException e) {
  +            saveException(pageContext, e);
  +            throw e;
  +        }
  +
  +    }
  +    /**
  +     * Locate and return the specified property of the specified bean, from
  +     * an optionally specified scope, in the specified page context.  If an
  +     * exception is thrown, it will have already been saved via a call to
  +     * <code>saveException()</code>.
  +     *
  +     * @param pageContext Page context to be searched
  +     * @param name Name of the bean to be retrieved
  +     * @param property Name of the property to be retrieved, or
  +     *  <code>null</code> to retrieve the bean itself
  +     * @param scope Scope to be searched (page, request, session, application)
  +     *  or <code>null</code> to use <code>findAttribute()</code> instead
  +     * @return property of specified JavaBean
  +     *
  +     * @exception JspException if an invalid scope name
  +     *  is requested
  +     * @exception JspException if the specified bean is not found
  +     * @exception JspException if accessing this property causes an
  +     *  IllegalAccessException, IllegalArgumentException,
  +     *  InvocationTargetException, or NoSuchMethodException
  +     * @since Struts 1.2
  +     */
  +    public static Object lookup(
  +        PageContext pageContext,
  +        String name,
  +        String property,
  +        String scope)
  +        throws JspException {
  +
  +        // Look up the requested bean, and return if requested
  +        Object bean = lookup(pageContext, name, scope);
  +        if (bean == null) {
  +            JspException e = null;
  +            if (scope == null) {
  +                e = new JspException(messages.getMessage("lookup.bean.any", name));
  +            } else {
  +                e = new JspException(messages.getMessage("lookup.bean", name, scope));
  +            }
  +            saveException(pageContext, e);
  +            throw e;
  +        }
  +
  +        if (property == null) {
  +            return bean;
  +        }
  +
  +        // Locate and return the specified property
  +        try {
  +            return PropertyUtils.getProperty(bean, property);
  +
  +        } catch (IllegalAccessException e) {
  +            saveException(pageContext, e);
  +            throw new JspException(messages.getMessage("lookup.access", property, name));
  +
  +        } catch (InvocationTargetException e) {
  +            Throwable t = e.getTargetException();
  +            if (t == null) {
  +                t = e;
  +            }
  +            saveException(pageContext, t);
  +            throw new JspException(messages.getMessage("lookup.target", property, name));
  +
  +        } catch (NoSuchMethodException e) {
  +            saveException(pageContext, e);
  +            throw new JspException(messages.getMessage("lookup.method", property, name));
  +        }
  +
  +    }
  +
  +    /**
  +     * Save the specified exception as a request attribute for later use.
  +     *
  +     * @param pageContext The PageContext for the current page
  +     * @param exception The exception to be saved
  +     */
  +    public static void saveException(PageContext pageContext, Throwable exception) {
  +
  +        pageContext.setAttribute(Globals.EXCEPTION_KEY, exception, PageContext.REQUEST_SCOPE);
  +
       }
   
   }
  
  
  
  1.22      +5 -5      jakarta-struts/src/share/org/apache/struts/taglib/bean/DefineTag.java
  
  Index: DefineTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/bean/DefineTag.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- DefineTag.java	26 Jul 2003 01:11:43 -0000	1.21
  +++ DefineTag.java	26 Jul 2003 17:22:27 -0000	1.22
  @@ -265,7 +265,7 @@
           // Retrieve the required property value
           Object value = this.value;
           if ((value == null) && (name != null)) {
  -            value = RequestUtils.lookup(pageContext, name, property, scope);
  +            value = TagUtils.getInstance().lookup(pageContext, name, property, scope);
           }
           if ((value == null) && (body != null)) {
               value = body;
  
  
  
  1.13      +6 -5      jakarta-struts/src/share/org/apache/struts/taglib/bean/MessageTag.java
  
  Index: MessageTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/bean/MessageTag.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- MessageTag.java	13 Jul 2003 23:57:32 -0000	1.12
  +++ MessageTag.java	26 Jul 2003 17:22:27 -0000	1.13
  @@ -67,6 +67,7 @@
   import javax.servlet.jsp.tagext.TagSupport;
   
   import org.apache.struts.Globals;
  +import org.apache.struts.taglib.TagUtils;
   import org.apache.struts.util.MessageResources;
   import org.apache.struts.util.RequestUtils;
   import org.apache.struts.util.ResponseUtils;
  @@ -252,7 +253,7 @@
           String key = this.key;
           if (key == null) {
               // Look up the requested property value
  -            Object value = RequestUtils.lookup(pageContext, name, property, scope);
  +            Object value = TagUtils.getInstance().lookup(pageContext, name, property, scope);
               if (value != null && !(value instanceof String)) {
                   JspException e =
                       new JspException(messages.getMessage("message.property", key));
  
  
  
  1.5       +6 -5      jakarta-struts/src/share/org/apache/struts/taglib/bean/SizeTag.java
  
  Index: SizeTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/bean/SizeTag.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SizeTag.java	25 Oct 2002 05:28:46 -0000	1.4
  +++ SizeTag.java	26 Jul 2003 17:22:27 -0000	1.5
  @@ -71,6 +71,7 @@
   import javax.servlet.jsp.tagext.TagSupport;
   import org.apache.struts.util.MessageResources;
   import org.apache.struts.util.RequestUtils;
  +import org.apache.struts.taglib.TagUtils;
   
   
   /**
  @@ -189,7 +190,7 @@
                   throw e;
               }
               
  -            value = RequestUtils.lookup(pageContext, name, property, scope);
  +            value = TagUtils.getInstance().lookup(pageContext, name, property, scope);
           }
   
           // Identify the number of elements, based on the collection type
  
  
  
  1.25      +6 -6      jakarta-struts/src/share/org/apache/struts/taglib/bean/WriteTag.java
  
  Index: WriteTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/bean/WriteTag.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- WriteTag.java	26 Jul 2003 01:17:55 -0000	1.24
  +++ WriteTag.java	26 Jul 2003 17:22:27 -0000	1.25
  @@ -262,13 +262,13 @@
   
           // Look up the requested bean (if necessary)
           if (ignore) {
  -            if (RequestUtils.lookup(pageContext, name, scope) == null) {
  +            if (TagUtils.getInstance().lookup(pageContext, name, scope) == null) {
                   return (SKIP_BODY); // Nothing to output
               }
           }
   
           // Look up the requested property value
  -        Object value = RequestUtils.lookup(pageContext, name, property, scope);
  +        Object value = TagUtils.getInstance().lookup(pageContext, name, property, scope);
   
           if (value == null) {
               return (SKIP_BODY); // Nothing to output
  
  
  
  1.19      +6 -5      jakarta-struts/src/share/org/apache/struts/taglib/html/BaseFieldTag.java
  
  Index: BaseFieldTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/BaseFieldTag.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- BaseFieldTag.java	4 Jul 2003 20:23:10 -0000	1.18
  +++ BaseFieldTag.java	26 Jul 2003 17:22:27 -0000	1.19
  @@ -64,6 +64,7 @@
   import javax.servlet.jsp.JspException;
   import org.apache.struts.util.RequestUtils;
   import org.apache.struts.util.ResponseUtils;
  +import org.apache.struts.taglib.TagUtils;
   
   /**
    * Convenience base class for the various input tags for text fields.
  @@ -192,7 +193,7 @@
               results.append(ResponseUtils.filter(value));
   
           } else if (redisplay || !"password".equals(type)) {
  -            Object value = RequestUtils.lookup(pageContext, name, property, null);
  +            Object value = TagUtils.getInstance().lookup(pageContext, name, property, null);
               if (value == null) {
                   value = "";
               }
  
  
  
  1.29      +6 -5      jakarta-struts/src/share/org/apache/struts/taglib/html/BaseHandlerTag.java
  
  Index: BaseHandlerTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/BaseHandlerTag.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- BaseHandlerTag.java	3 Jul 2003 04:54:35 -0000	1.28
  +++ BaseHandlerTag.java	26 Jul 2003 17:22:27 -0000	1.29
  @@ -73,6 +73,7 @@
   import org.apache.commons.logging.LogFactory;
   import org.apache.struts.Globals;
   import org.apache.struts.taglib.logic.IterateTag;
  +import org.apache.struts.taglib.TagUtils;
   import org.apache.struts.util.MessageResources;
   import org.apache.struts.util.RequestUtils;
   
  @@ -904,7 +905,7 @@
       protected String lookupProperty(String beanName, String property)
           throws JspException {
   
  -        Object bean = RequestUtils.lookup(this.pageContext, beanName, null);
  +        Object bean = TagUtils.getInstance().lookup(this.pageContext, beanName, null);
           if (bean == null) {
               throw new JspException(messages.getMessage("getter.bean", beanName));
           }
  
  
  
  1.18      +6 -5      jakarta-struts/src/share/org/apache/struts/taglib/html/CheckboxTag.java
  
  Index: CheckboxTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/CheckboxTag.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- CheckboxTag.java	16 Nov 2002 06:05:21 -0000	1.17
  +++ CheckboxTag.java	26 Jul 2003 17:22:27 -0000	1.18
  @@ -67,6 +67,7 @@
   import org.apache.struts.util.MessageResources;
   import org.apache.struts.util.RequestUtils;
   import org.apache.struts.util.ResponseUtils;
  +import org.apache.struts.taglib.TagUtils;
   
   
   /**
  @@ -204,7 +205,7 @@
           else
               results.append(value);
           results.append("\"");
  -        Object result = RequestUtils.lookup(pageContext, name,
  +        Object result = TagUtils.getInstance().lookup(pageContext, name,
                                               property, null);
           if (result == null)
               result = "";
  
  
  
  1.5       +6 -5      jakarta-struts/src/share/org/apache/struts/taglib/html/HiddenTag.java
  
  Index: HiddenTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/HiddenTag.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- HiddenTag.java	5 Oct 2002 22:53:57 -0000	1.4
  +++ HiddenTag.java	26 Jul 2003 17:22:27 -0000	1.5
  @@ -66,6 +66,7 @@
   import javax.servlet.jsp.JspException;
   import org.apache.struts.util.RequestUtils;
   import org.apache.struts.util.ResponseUtils;
  +import org.apache.struts.taglib.TagUtils;
   
   
   /**
  @@ -134,7 +135,7 @@
           if (value != null) {
               results = ResponseUtils.filter(value);
           } else {
  -            Object value = RequestUtils.lookup(pageContext, name, property,
  +            Object value = TagUtils.getInstance().lookup(pageContext, name, property,
                                                  null);
               if (value == null) {
                   results = "";
  
  
  
  1.28      +7 -6      jakarta-struts/src/share/org/apache/struts/taglib/html/ImgTag.java
  
  Index: ImgTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/ImgTag.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- ImgTag.java	12 Mar 2003 00:42:18 -0000	1.27
  +++ ImgTag.java	26 Jul 2003 17:22:27 -0000	1.28
  @@ -69,6 +69,7 @@
   import javax.servlet.jsp.JspException;
   
   import org.apache.struts.Globals;
  +import org.apache.struts.taglib.TagUtils;
   import org.apache.struts.config.ModuleConfig;
   import org.apache.struts.util.MessageResources;
   import org.apache.struts.util.RequestUtils;
  @@ -602,7 +603,7 @@
               }
               src.append(paramId);
               src.append('=');
  -            Object value = RequestUtils.lookup(pageContext, paramName, paramProperty, paramScope);
  +            Object value = TagUtils.getInstance().lookup(pageContext, paramName, paramProperty, paramScope);
               if (value != null)
                   src.append(RequestUtils.encodeURL(value.toString()));
           }
  @@ -619,7 +620,7 @@
           }
   
           // Look up the map we will be using
  -        Object mapObject = RequestUtils.lookup(pageContext, name, property, scope);
  +        Object mapObject = TagUtils.getInstance().lookup(pageContext, name, property, scope);
           Map map = null;
           try {
               map = (Map) mapObject;
  
  
  
  1.19      +6 -5      jakarta-struts/src/share/org/apache/struts/taglib/html/MultiboxTag.java
  
  Index: MultiboxTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/MultiboxTag.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- MultiboxTag.java	16 Dec 2002 03:41:43 -0000	1.18
  +++ MultiboxTag.java	26 Jul 2003 17:22:27 -0000	1.19
  @@ -68,6 +68,7 @@
   
   import org.apache.commons.beanutils.BeanUtils;
   import org.apache.struts.Globals;
  +import org.apache.struts.taglib.TagUtils;
   import org.apache.struts.util.MessageResources;
   import org.apache.struts.util.RequestUtils;
   import org.apache.struts.util.ResponseUtils;
  @@ -230,7 +231,7 @@
           }
           results.append(ResponseUtils.filter(value));
           results.append("\"");
  -        Object bean = RequestUtils.lookup(pageContext, name, null);
  +        Object bean = TagUtils.getInstance().lookup(pageContext, name, null);
           String values[] = null;
           if (bean == null)
               throw new JspException(messages.getMessage("getter.bean", name));
  
  
  
  1.10      +6 -5      jakarta-struts/src/share/org/apache/struts/taglib/html/OptionsCollectionTag.java
  
  Index: OptionsCollectionTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/OptionsCollectionTag.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- OptionsCollectionTag.java	1 Feb 2003 05:30:28 -0000	1.9
  +++ OptionsCollectionTag.java	26 Jul 2003 17:22:27 -0000	1.10
  @@ -76,6 +76,7 @@
   import org.apache.struts.util.MessageResources;
   import org.apache.struts.util.RequestUtils;
   import org.apache.struts.util.ResponseUtils;
  +import org.apache.struts.taglib.TagUtils;
   
   /**
    * Tag for creating multiple &lt;select&gt; options from a collection. The
  @@ -216,7 +217,7 @@
           }
   
           // Acquire the collection containing our options
  -        Object collection = RequestUtils.lookup(pageContext, name, property, null);
  +        Object collection = TagUtils.getInstance().lookup(pageContext, name, property, null);
   
           if (collection == null) {
               JspException e =
  
  
  
  1.23      +5 -4      jakarta-struts/src/share/org/apache/struts/taglib/html/OptionsTag.java
  
  Index: OptionsTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/OptionsTag.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- OptionsTag.java	1 Feb 2003 05:30:28 -0000	1.22
  +++ OptionsTag.java	26 Jul 2003 17:22:27 -0000	1.23
  @@ -76,6 +76,7 @@
   import org.apache.struts.util.MessageResources;
   import org.apache.struts.util.RequestUtils;
   import org.apache.struts.util.ResponseUtils;
  +import org.apache.struts.taglib.TagUtils;
   
   /**
    * Tag for creating multiple &lt;select&gt; options from a collection.  The
  @@ -402,7 +403,7 @@
               beanName = Constants.BEAN_KEY;
           }
   
  -        Object bean = RequestUtils.lookup(pageContext, beanName, null);
  +        Object bean = TagUtils.getInstance().lookup(pageContext, beanName, null);
           if (bean == null) {
               throw new JspException(messages.getMessage("getter.bean", beanName));
           }
  
  
  
  1.16      +6 -5      jakarta-struts/src/share/org/apache/struts/taglib/html/SelectTag.java
  
  Index: SelectTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/SelectTag.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- SelectTag.java	18 May 2003 19:18:00 -0000	1.15
  +++ SelectTag.java	26 Jul 2003 17:22:27 -0000	1.16
  @@ -67,6 +67,7 @@
   import org.apache.struts.util.MessageResources;
   import org.apache.struts.util.RequestUtils;
   import org.apache.struts.util.ResponseUtils;
  +import org.apache.struts.taglib.TagUtils;
   
   /**
    * Custom tag that represents an HTML select element, associated with a
  @@ -296,7 +297,7 @@
               this.match[0] = this.value;
               
           } else {
  -            Object bean = RequestUtils.lookup(pageContext, name, null);
  +            Object bean = TagUtils.getInstance().lookup(pageContext, name, null);
               if (bean == null) {
                   JspException e =
                       new JspException(messages.getMessage("getter.bean", name));
  
  
  
  1.10      +6 -5      jakarta-struts/src/share/org/apache/struts/taglib/logic/CompareTagBase.java
  
  Index: CompareTagBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/logic/CompareTagBase.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- CompareTagBase.java	23 Sep 2002 05:22:08 -0000	1.9
  +++ CompareTagBase.java	26 Jul 2003 17:22:28 -0000	1.10
  @@ -70,6 +70,7 @@
   import org.apache.commons.beanutils.PropertyUtils;
   import org.apache.struts.util.MessageResources;
   import org.apache.struts.util.RequestUtils;
  +import org.apache.struts.taglib.TagUtils;
   
   
   /**
  @@ -215,7 +216,7 @@
                   ((HttpServletRequest) pageContext.getRequest()).
                   getHeader(header);
           } else if (name != null) {
  -            Object bean = RequestUtils.lookup(pageContext, name, scope);
  +            Object bean = TagUtils.getInstance().lookup(pageContext, name, scope);
               if (property != null) {
                   if (bean == null) {
                       JspException e = new JspException
  
  
  
  1.9       +7 -6      jakarta-struts/src/share/org/apache/struts/taglib/logic/EmptyTag.java
  
  Index: EmptyTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/logic/EmptyTag.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- EmptyTag.java	13 Jul 2003 23:28:03 -0000	1.8
  +++ EmptyTag.java	26 Jul 2003 17:22:28 -0000	1.9
  @@ -67,6 +67,7 @@
   import javax.servlet.jsp.JspException;
   
   import org.apache.struts.util.RequestUtils;
  +import org.apache.struts.taglib.TagUtils;
   
   /**
    * Evalute the nested body content of this tag if the specified value
  @@ -118,9 +119,9 @@
           
   		Object value = null;
   		if (this.property == null) {
  -			value = RequestUtils.lookup(pageContext, name, scope);
  +			value = TagUtils.getInstance().lookup(pageContext, name, scope);
   		} else {
  -			value = RequestUtils.lookup(pageContext, name, property, scope);
  +			value = TagUtils.getInstance().lookup(pageContext, name, property, scope);
   		}
           
           boolean empty = true;
  
  
  
  1.22      +8 -7      jakarta-struts/src/share/org/apache/struts/taglib/logic/IterateTag.java
  
  Index: IterateTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/logic/IterateTag.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- IterateTag.java	4 Mar 2003 04:46:03 -0000	1.21
  +++ IterateTag.java	26 Jul 2003 17:22:28 -0000	1.22
  @@ -76,6 +76,7 @@
   import org.apache.struts.util.MessageResources;
   import org.apache.struts.util.RequestUtils;
   import org.apache.struts.util.ResponseUtils;
  +import org.apache.struts.taglib.TagUtils;
   
   /**
    * Custom tag that iterates the elements of a collection, which can be
  @@ -274,7 +275,7 @@
           // Acquire the collection we are going to iterate over
           Object collection = this.collection;
           if (collection == null) {
  -            collection = RequestUtils.lookup(pageContext, name, property, scope);
  +            collection = TagUtils.getInstance().lookup(pageContext, name, property, scope);
           }
   
           if (collection == null) {
  @@ -319,7 +320,7 @@
               try {
                   offsetValue = Integer.parseInt(offset);
               } catch (NumberFormatException e) {
  -                Integer offsetObject = (Integer) RequestUtils.lookup(pageContext, offset, null);
  +                Integer offsetObject = (Integer) TagUtils.getInstance().lookup(pageContext, offset, null);
                   if (offsetObject == null) {
                       offsetValue = 0;
                   } else {
  @@ -338,7 +339,7 @@
               try {
                   lengthValue = Integer.parseInt(length);
               } catch (NumberFormatException e) {
  -                Integer lengthObject = (Integer) RequestUtils.lookup(pageContext, length, null);
  +                Integer lengthObject = (Integer) TagUtils.getInstance().lookup(pageContext, length, null);
                   if (lengthObject == null) {
                       lengthValue = 0;
                   } else {
  
  
  
  1.10      +6 -5      jakarta-struts/src/share/org/apache/struts/taglib/logic/MatchTag.java
  
  Index: MatchTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/logic/MatchTag.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- MatchTag.java	23 Sep 2002 05:22:08 -0000	1.9
  +++ MatchTag.java	26 Jul 2003 17:22:28 -0000	1.10
  @@ -67,6 +67,7 @@
   import javax.servlet.http.HttpServletRequest;
   import javax.servlet.jsp.JspException;
   import org.apache.struts.util.RequestUtils;
  +import org.apache.struts.taglib.TagUtils;
   
   
   /**
  @@ -178,7 +179,7 @@
                   getHeader(header);
           } else if (name != null) {
               Object value =
  -                RequestUtils.lookup(pageContext, name, property, scope);
  +                TagUtils.getInstance().lookup(pageContext, name, property, scope);
               if (value != null)
                   variable = value.toString();
           } else if (parameter != null) {
  
  
  
  1.16      +7 -6      jakarta-struts/src/share/org/apache/struts/taglib/logic/PresentTag.java
  
  Index: PresentTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/logic/PresentTag.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- PresentTag.java	13 Jul 2003 23:50:50 -0000	1.15
  +++ PresentTag.java	26 Jul 2003 17:22:28 -0000	1.16
  @@ -69,6 +69,7 @@
   import javax.servlet.jsp.JspException;
   
   import org.apache.struts.util.RequestUtils;
  +import org.apache.struts.taglib.TagUtils;
   
   /**
    * Evalute the nested body content of this tag if the specified value
  @@ -158,9 +159,9 @@
           Object value = null;
           try {
               if (this.property != null) {
  -                value = RequestUtils.lookup(pageContext, name, this.property, scope);
  +                value = TagUtils.getInstance().lookup(pageContext, name, this.property, scope);
               } else {
  -                value = RequestUtils.lookup(pageContext, name, scope);
  +                value = TagUtils.getInstance().lookup(pageContext, name, scope);
               }
           } catch (JspException e) {
               value = null;
  
  
  

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