jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From morg...@apache.org
Subject cvs commit: jakarta-taglibs/scopes/src/org/apache/taglibs/scopes BaseMultiTag.java ExistsTag.java NotExistsTag.java BaseScopedBodyTag.java BaseScopedTag.java EqualsAttributeTag.java ExistsAttributeTag.java ExistsInitParameterTag.java
Date Fri, 09 Mar 2001 00:24:44 GMT
morgand     01/03/08 16:24:44

  Modified:    scopes/src/org/apache/taglibs/scopes BaseScopedBodyTag.java
                        BaseScopedTag.java EqualsAttributeTag.java
  Added:       scopes/src/org/apache/taglibs/scopes BaseMultiTag.java
                        ExistsTag.java NotExistsTag.java
  Removed:     scopes/src/org/apache/taglibs/scopes ExistsAttributeTag.java
                        ExistsInitParameterTag.java
  Log:
  no message
  
  Revision  Changes    Path
  1.3       +1 -1      jakarta-taglibs/scopes/src/org/apache/taglibs/scopes/BaseScopedBodyTag.java
  
  Index: BaseScopedBodyTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/scopes/src/org/apache/taglibs/scopes/BaseScopedBodyTag.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BaseScopedBodyTag.java	2001/03/07 01:54:17	1.2
  +++ BaseScopedBodyTag.java	2001/03/09 00:24:38	1.3
  @@ -61,7 +61,7 @@
   import javax.servlet.jsp.tagext.BodyTagSupport;
   import javax.servlet.jsp.PageContext;
   
  -public class BaseScopedBodyTag extends BodyTagSupport {
  +public abstract class BaseScopedBodyTag extends BodyTagSupport {
         
     protected int _scope = PageContext.PAGE_SCOPE;
     protected boolean _scopeSet = false;
  
  
  
  1.3       +1 -1      jakarta-taglibs/scopes/src/org/apache/taglibs/scopes/BaseScopedTag.java
  
  Index: BaseScopedTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/scopes/src/org/apache/taglibs/scopes/BaseScopedTag.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BaseScopedTag.java	2001/03/07 01:54:17	1.2
  +++ BaseScopedTag.java	2001/03/09 00:24:38	1.3
  @@ -62,7 +62,7 @@
   import javax.servlet.jsp.tagext.TagSupport;
   import javax.servlet.jsp.PageContext;
   
  -public class BaseScopedTag extends TagSupport {
  +public abstract class BaseScopedTag extends TagSupport {
         
     protected int _scope = PageContext.PAGE_SCOPE;
     protected boolean _scopeSet = false;
  
  
  
  1.2       +2 -2      jakarta-taglibs/scopes/src/org/apache/taglibs/scopes/EqualsAttributeTag.java
  
  Index: EqualsAttributeTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/scopes/src/org/apache/taglibs/scopes/EqualsAttributeTag.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EqualsAttributeTag.java	2001/03/06 23:07:57	1.1
  +++ EqualsAttributeTag.java	2001/03/09 00:24:39	1.2
  @@ -131,7 +131,7 @@
       public final int doStartTag() throws JspException
       {
         //result is whether or not tag contents equal the _match attribute
  -	    boolean result = false;
  +      boolean result = false;
         Object attribute = pageContext.getAttribute(_name,_scope);
         
         if (attribute == null) {
  @@ -139,7 +139,7 @@
         } else {
           String attributeValue = attribute.toString();
           
  -	      if (_ignorecase.booleanValue() == true) {
  +	if (_ignorecase.booleanValue() == true) {
             result = attributeValue.equalsIgnoreCase(_match);
           } else {
             result = attributeValue.equals(_match);
  
  
  
  1.1                  jakarta-taglibs/scopes/src/org/apache/taglibs/scopes/BaseMultiTag.java
  
  Index: BaseMultiTag.java
  ===================================================================
  
  /*
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The _names "The Jakarta Project", "Tomcat", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their _names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  
  package org.apache.taglibs.scopes;
  
  public abstract class BaseMultiTag extends BaseScopedTag {
  
    protected String _parameter = null;
    protected String _attribute = null;
    protected String _initParameter = null;
  
    public void setParameter(String parameter) {
      _parameter = parameter;
    }
  
    public void setAttribute(String attribute) {
      _attribute = attribute;
    }
  
    public void setInitParameter(String initParameter) {
      _initParameter = initParameter;
    }
  
  }
  
  
  
  1.1                  jakarta-taglibs/scopes/src/org/apache/taglibs/scopes/ExistsTag.java
  
  Index: ExistsTag.java
  ===================================================================
  package org.apache.taglibs.scopes;
  
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.jsp.JspTagException;
  
  public class ExistsTag extends BaseMultiTag {
  
    public int doStartTag() throws JspTagException {
      if (exists() == true) {
        return EVAL_BODY_INCLUDE;
      } 
  
      return SKIP_BODY;
    }
  
    protected boolean exists() throws JspTagException {
      if (_parameter != null) {
        return parameterExists();
      } else if (_attribute != null) {
        return attributeExists();
      } else if (_initParameter != null) {
        return initParameterExists();
      }
  
      //must be an undefined attribute
      throw new JspTagException();
    }
  
    protected boolean initParameterExists() {
      if( pageContext.getServletContext().getInitParameter(_initParameter) != null ) {
        return true;
      }
      
      return false;
    }
  
    protected boolean parameterExists() {
      // does the request parameter exist?
      String tmp = ((HttpServletRequest)pageContext.getRequest()).getParameter(_parameter);
      if ( tmp != null && tmp.length() > 0 ) {
        return true;
      }
  
      return false;
    }
  
    protected boolean attributeExists() {
  
      Object o = null;
      if (_scopeSet == false) {
        o = pageContext.findAttribute(_attribute);
      } else {
        o = pageContext.getAttribute(_attribute,_scope);
      }
  
      if (o != null ) {
        return true;
      }
  
      return false;
    }
  }
  
  
  
  1.1                  jakarta-taglibs/scopes/src/org/apache/taglibs/scopes/NotExistsTag.java
  
  Index: NotExistsTag.java
  ===================================================================
  package org.apache.taglibs.scopes;
  
  import javax.servlet.jsp.JspTagException;
  
  public class NotExistsTag extends ExistsTag {
  
    public int doStartTag() throws JspTagException {
      if (exists() == false) {
        return EVAL_BODY_INCLUDE;
      }
  
      return SKIP_BODY;
    }
  
  }
  
  
  

Mime
View raw message