jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu...@apache.org
Subject cvs commit: jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tei MessageFormatTEI.java MessageTEI.java BundleTEI.java FormatDateTEI.java FormatNumberTEI.java LocaleTEI.java TimeZoneTEI.java Util.java
Date Sat, 17 Nov 2001 00:18:08 GMT
luehe       01/11/16 16:18:08

  Modified:    jsptl/conf jr.tld jx.tld
               jsptl/examples/web/i18n Message.jsp
               jsptl/src/org/apache/taglibs/jsptl/tag/common
                        BundleSupport.java FormatDateSupport.java
                        FormatNumberSupport.java LocaleSupport.java
                        MessageFormatSupport.java MessageSupport.java
                        ParseDateSupport.java ParseNumberSupport.java
                        TimeZoneSupport.java
               jsptl/src/org/apache/taglibs/jsptl/tei BundleTEI.java
                        FormatDateTEI.java FormatNumberTEI.java
                        LocaleTEI.java TimeZoneTEI.java Util.java
  Added:       jsptl/src/org/apache/taglibs/jsptl/extra/i18n Locale.java
               jsptl/src/org/apache/taglibs/jsptl/tag/common Util.java
               jsptl/src/org/apache/taglibs/jsptl/tei MessageFormatTEI.java
                        MessageTEI.java
  Log:
  Added 'scope' attribute to I18N/Formatting tags
  
  Revision  Changes    Path
  1.6       +52 -0     jakarta-taglibs/jsptl/conf/jr.tld
  
  Index: jr.tld
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/jsptl/conf/jr.tld,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- jr.tld	2001/11/16 00:20:06	1.5
  +++ jr.tld	2001/11/17 00:18:07	1.6
  @@ -308,6 +308,11 @@
           <required>false</required>
           <rtexprvalue>true</rtexprvalue>
       </attribute>
  +    <attribute>
  +        <name>scope</name>
  +        <required>false</required>
  +        <rtexprvalue>false</rtexprvalue>
  +    </attribute>
     </tag>
   
     <tag>
  @@ -324,6 +329,16 @@
           <required>true</required>
           <rtexprvalue>true</rtexprvalue>
       </attribute>
  +    <attribute>
  +        <name>var</name>
  +        <required>false</required>
  +        <rtexprvalue>false</rtexprvalue>
  +    </attribute>
  +    <attribute>
  +        <name>scope</name>
  +        <required>false</required>
  +        <rtexprvalue>false</rtexprvalue>
  +    </attribute>
     </tag>
   
     <tag>
  @@ -349,11 +364,17 @@
           <required>false</required>
           <rtexprvalue>false</rtexprvalue>
       </attribute>
  +    <attribute>
  +        <name>scope</name>
  +        <required>false</required>
  +        <rtexprvalue>false</rtexprvalue>
  +    </attribute>
     </tag>
   
     <tag>
       <name>message</name>
       <tag-class>org.apache.taglibs.jsptl.tag.jr.MessageTag</tag-class>
  +    <tei-class>org.apache.taglibs.jsptl.tei.MessageTEI</tei-class>
       <body-content>JSP</body-content>
       <description>
           Maps key to localized message and performs parametric replacement
  @@ -373,11 +394,17 @@
           <required>false</required>
           <rtexprvalue>false</rtexprvalue>
       </attribute>
  +    <attribute>
  +        <name>scope</name>
  +        <required>false</required>
  +        <rtexprvalue>false</rtexprvalue>
  +    </attribute>
     </tag>
   
     <tag>
       <name>messageFormat</name>
       <tag-class>org.apache.taglibs.jsptl.tag.jr.MessageFormatTag</tag-class>
  +    <tei-class>org.apache.taglibs.jsptl.tei.MessageFormatTEI</tei-class>
       <body-content>JSP</body-content>
       <description>
           Performs parametric replacement on a given pattern string
  @@ -392,6 +419,11 @@
           <required>false</required>
           <rtexprvalue>false</rtexprvalue>
       </attribute>
  +    <attribute>
  +        <name>scope</name>
  +        <required>false</required>
  +        <rtexprvalue>false</rtexprvalue>
  +    </attribute>
     </tag>
   
     <tag>
  @@ -437,6 +469,11 @@
           <required>false</required>
           <rtexprvalue>false</rtexprvalue>
       </attribute>
  +    <attribute>
  +        <name>scope</name>
  +        <required>false</required>
  +        <rtexprvalue>false</rtexprvalue>
  +    </attribute>
     </tag>
   
     <tag>
  @@ -467,6 +504,11 @@
           <required>false</required>
           <rtexprvalue>false</rtexprvalue>
       </attribute>
  +    <attribute>
  +        <name>scope</name>
  +        <required>false</required>
  +        <rtexprvalue>false</rtexprvalue>
  +    </attribute>
     </tag>
   
     <tag>
  @@ -512,6 +554,11 @@
           <required>false</required>
           <rtexprvalue>false</rtexprvalue>
       </attribute>
  +    <attribute>
  +        <name>scope</name>
  +        <required>false</required>
  +        <rtexprvalue>false</rtexprvalue>
  +    </attribute>
     </tag>
   
     <tag>
  @@ -539,6 +586,11 @@
       </attribute>
       <attribute>
           <name>var</name>
  +        <required>false</required>
  +        <rtexprvalue>false</rtexprvalue>
  +    </attribute>
  +    <attribute>
  +        <name>scope</name>
           <required>false</required>
           <rtexprvalue>false</rtexprvalue>
       </attribute>
  
  
  
  1.6       +53 -1     jakarta-taglibs/jsptl/conf/jx.tld
  
  Index: jx.tld
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/jsptl/conf/jx.tld,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- jx.tld	2001/11/16 00:20:06	1.5
  +++ jx.tld	2001/11/17 00:18:07	1.6
  @@ -386,10 +386,15 @@
           <rtexprvalue>false</rtexprvalue>
       </attribute>
       <attribute>
  -        <name>locale</name>
  +        <name>variant</name>
           <required>false</required>
           <rtexprvalue>false</rtexprvalue>
       </attribute>
  +    <attribute>
  +        <name>scope</name>
  +        <required>false</required>
  +        <rtexprvalue>false</rtexprvalue>
  +    </attribute>
     </tag>
   
     <tag>
  @@ -406,6 +411,16 @@
           <required>true</required>
           <rtexprvalue>false</rtexprvalue>
       </attribute>
  +    <attribute>
  +        <name>var</name>
  +        <required>false</required>
  +        <rtexprvalue>false</rtexprvalue>
  +    </attribute>
  +    <attribute>
  +        <name>scope</name>
  +        <required>false</required>
  +        <rtexprvalue>false</rtexprvalue>
  +    </attribute>
     </tag>
   
     <tag>
  @@ -431,11 +446,17 @@
           <required>false</required>
           <rtexprvalue>false</rtexprvalue>
       </attribute>
  +    <attribute>
  +        <name>scope</name>
  +        <required>false</required>
  +        <rtexprvalue>false</rtexprvalue>
  +    </attribute>
     </tag>
   
     <tag>
       <name>message</name>
       <tag-class>org.apache.taglibs.jsptl.tag.jx.MessageTag</tag-class>
  +    <tei-class>org.apache.taglibs.jsptl.tei.MessageTEI</tei-class>
       <body-content>JSP</body-content>
       <description>
           Maps key to localized message and performs parametric replacement
  @@ -455,11 +476,17 @@
           <required>false</required>
           <rtexprvalue>false</rtexprvalue>
       </attribute>
  +    <attribute>
  +        <name>scope</name>
  +        <required>false</required>
  +        <rtexprvalue>false</rtexprvalue>
  +    </attribute>
     </tag>
   
     <tag>
       <name>messageFormat</name>
       <tag-class>org.apache.taglibs.jsptl.tag.jx.MessageFormatTag</tag-class>
  +    <tei-class>org.apache.taglibs.jsptl.tei.MessageFormatTEI</tei-class>
       <body-content>JSP</body-content>
       <description>
           Performs parametric replacement on a given pattern string
  @@ -474,6 +501,11 @@
           <required>false</required>
           <rtexprvalue>false</rtexprvalue>
       </attribute>
  +    <attribute>
  +        <name>scope</name>
  +        <required>false</required>
  +        <rtexprvalue>false</rtexprvalue>
  +    </attribute>
     </tag>
   
     <tag>
  @@ -519,6 +551,11 @@
           <required>false</required>
           <rtexprvalue>false</rtexprvalue>
       </attribute>
  +    <attribute>
  +        <name>scope</name>
  +        <required>false</required>
  +        <rtexprvalue>false</rtexprvalue>
  +    </attribute>
     </tag>
   
     <tag>
  @@ -549,6 +586,11 @@
           <required>false</required>
           <rtexprvalue>false</rtexprvalue>
       </attribute>
  +    <attribute>
  +        <name>scope</name>
  +        <required>false</required>
  +        <rtexprvalue>false</rtexprvalue>
  +    </attribute>
     </tag>
   
     <tag>
  @@ -594,6 +636,11 @@
           <required>false</required>
           <rtexprvalue>false</rtexprvalue>
       </attribute>
  +    <attribute>
  +        <name>scope</name>
  +        <required>false</required>
  +        <rtexprvalue>false</rtexprvalue>
  +    </attribute>
     </tag>
   
     <tag>
  @@ -621,6 +668,11 @@
       </attribute>
       <attribute>
           <name>var</name>
  +        <required>false</required>
  +        <rtexprvalue>false</rtexprvalue>
  +    </attribute>
  +    <attribute>
  +        <name>scope</name>
           <required>false</required>
           <rtexprvalue>false</rtexprvalue>
       </attribute>
  
  
  
  1.2       +1 -1      jakarta-taglibs/jsptl/examples/web/i18n/Message.jsp
  
  Index: Message.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/jsptl/examples/web/i18n/Message.jsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Message.jsp	2001/11/16 00:20:07	1.1
  +++ Message.jsp	2001/11/17 00:18:07	1.2
  @@ -33,7 +33,7 @@
   
    <li> Italian locale:<br>
     <jx:locale value="it"/>
  -  <jx:bundle basename="org.apache.taglibs.jsptl.examples.i18n.Resources" var="itBundle"/>
  +  <jx:bundle basename="org.apache.taglibs.jsptl.examples.i18n.Resources" var="itBundle" scope="page"/>
     <jx:message key="greetingMorning" bundle="$itBundle"/>
   
    <li> Parametric replacement:
  
  
  
  1.1                  jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/extra/i18n/Locale.java
  
  Index: Locale.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.jsptl.extra.i18n;
  
  import java.util.*;
  import java.text.*;
  import javax.servlet.jsp.*;
  import org.apache.taglibs.jsptl.tag.common.BundleSupport;
  import org.apache.taglibs.jsptl.tag.common.MessageSupport;
  import org.apache.taglibs.jsptl.resources.Resources;
  
  /**
   * Exposes the resource bundle locale-determination logic through utility 
   * methods to any tag handlers that need to produce localized messages.
   *
   * <p> A resource bundle's locale is determined as follows:
   *
   * <ul>
   * <li> If the <tt>javax.servlet.jsp.jsptl.i18n.locale</tt> scoped 
   * attribute exists, use the locale stored as its value.
   *
   * <li> Otherwise, compare the client's preferred locales (in order of
   * preference) against the available locales for the resource bundle's base
   * name, and use the best matching locale.
   * The best matching locale is defined as the client's preferred locale that
   * matches both the language and country components of an available locale for
   * the base name in question. This is considered an exact match.
   * If no exact match exists, the first client locale that matches (just) the
   * language component of an available locale is used.
   *
   * <li> If no match is found, use the fallback locale given by the
   * <tt>javax.servlet.jsp.jsptl.i18n.fallbackLocale</tt> scoped attribute, if it
   * exists.
   *
   * <li> Otherwise, use the runtime's default locale.
   * </ul>
   *
   * @author Jan Luehe
   */
  
  public class Locale {
  
      /** 
       * Retrieves the localized message corresponding to the given key. 
       * 
       * The given key is looked up in the resource bundle whose base 
       * name is retrieved from the
       * <tt>javax.servlet.jsp.jsptl.i18n.basename</tt> scoped attribute and
       * whose locale is determined according to the algorithm described in
       * the header of this class. 
       * 
       * If the <tt>javax.servlet.jsp.jsptl.i18n.basename</tt> attribute is not
       * found in any of the scopes, or no resource bundle with that base name
       * exists, or the given key is undefined in the resource bundle that was
       * loaded as a result of this call, the string
       * &quot;???&lt;key&gt;???&quot; is returned, where
       * &quot;&lt;key&gt;&quot; is replaced with the given <tt>key</tt>
       * argument.
       * 
       * @param pageContext the page in which the given key must be localized 
       * @param key the message key to be looked up 
       * 
       * @return the localized message corresponding to the given key 
       */ 
      public static String getLocalizedMessage(PageContext pageContext, 
                                               String key) {
  	return getLocalizedMessage(pageContext, key, null, null);
      }
  
      /** 
       * Retrieves the localized message corresponding to the given key. 
       * 
       * The given key is looked up in the resource bundle with the given 
       * base name whose locale is determined according to the 
       * algorithm described in the header of this class.
       * 
       * If no resource bundle with the given base name exists, 
       * or the given key is undefined in the resource bundle that was loaded as 
       * a result of this call, the string
       * &quot;???&lt;key&gt;???&quot; is returned, where
       * &quot;&lt;key&gt;&quot; is replaced with the given <tt>key</tt>
       * argument.
       * 
       * @param pageContext the page in which the given key must be localized 
       * @param key the message key to be looked up 
       * @param basename the resource bundle base name 
       * 
       * @return the localized message corresponding to the given key 
       */ 
      public static String getLocalizedMessage(PageContext pageContext, 
                                               String key, 
                                               String basename) {
  	return getLocalizedMessage(pageContext, key, null, basename);
      }
  
      /** 
       * Retrieves the localized message corresponding to the given key and 
       * performs parametric replacement using the arguments specified in the 
       * <tt>args</tt> parameter. 
       * 
       * The given key is looked up in the resource bundle whose base 
       * name is retrieved from the
       * <tt>javax.servlet.jsp.jsptl.i18n.basename</tt> scoped attribute and
       * whose locale is determined according to the algorithm described in the
       * header of this class.
       * 
       * Before being returned, the result of the lookup undergoes parametric 
       * replacement, using the arguments specified in the <tt>args</tt> 
       * parameter. 
       * 
       * If the <tt>javax.servlet.jsp.jsptl.i18n.basename</tt> attribute is not
       * found in any of the scopes, or no resource bundle with that base name
       * exists, or the given key is undefined in the resource bundle that was
       * loaded as a result of this call, the string
       * &quot;???&lt;key&gt;???&quot; is returned, where
       * &quot;&lt;key&gt;&quot; is replaced with the given <tt>key</tt>
       * argument.
       * 
       * @param pageContext the page in which the given key must be localized 
       * @param key the message key to be looked up 
       * @param args the arguments for parametric replacement 
       * 
       * @return the localized message corresponding to the given key 
       */ 
      public static String getLocalizedMessage(PageContext pageContext, 
                                               String key, 
                                               Object[] args) {
  	return getLocalizedMessage(pageContext, key, args, null);
      }
  
      /** 
       * Retrieves the localized message corresponding to the given key. 
       * 
       * The given key is looked up in the resource bundle with the given 
       * base name whose locale is determined according to the 
       * algorithm described in the header of this class.
       * 
       * Before being returned, the result of the lookup undergoes parametric 
       * replacement, using the arguments specified in the <tt>args</tt> 
       * parameter. 
       * 
       * If no resource bundle with the given base name exists, 
       * or the given key is undefined in the resource bundle that was loaded as 
       * a result of this call, the string &quot;???&lt;key&gt;???&quot; is
       * returned, where &quot;&lt;key&gt;&quot; is replaced with the given
       * <tt>key</tt> argument.
       * 
       * @param pageContext the page in which the given key must be localized 
       * @param key the message key to be looked up 
       * @param args the arguments for parametric replacement 
       * @param basename the resource bundle base name 
       * 
       * @return the localized message corresponding to the given key 
       */ 
      public static String getLocalizedMessage(PageContext pageContext, 
                                               String key, 
                                               Object[] args, 
                                               String basename) {
  	ResourceBundle bundle = null;
  	String message = MessageSupport.UNKNOWN_KEY + key
  	    + MessageSupport.UNKNOWN_KEY;
  
  	if (basename != null)
  	    bundle = BundleSupport.getBundle(pageContext, basename);
  	else
  	    bundle = BundleSupport.getDefaultBundle(pageContext);
  
  	if (bundle != null) {
  	    try {
  		message = bundle.getString(key);
  		if (args != null) {
  		    MessageFormat formatter = new MessageFormat("");
  		    formatter.setLocale(bundle.getLocale());
  		    formatter.applyPattern(message);
  		    message = formatter.format(args);
  		}
  	    } catch (MissingResourceException mre) {
  	    }
  	}
  
  	return message;
      }
  }
  
  
  
  
  1.2       +27 -30    jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tag/common/BundleSupport.java
  
  Index: BundleSupport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tag/common/BundleSupport.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BundleSupport.java	2001/11/16 00:20:07	1.1
  +++ BundleSupport.java	2001/11/17 00:18:07	1.2
  @@ -82,10 +82,7 @@
       private static final String FALLBACK_LOCALE_ATTRIBUTE =
   	"javax.servlet.jsp.jsptl.i18n.fallbackLocale";
   
  -    private static final String REQUEST_STRING = "request";   // request scope
  -    private static final String SESSION_STRING = "session";   // session scope
   
  -
       //*********************************************************************
       // Protected state
   
  @@ -124,9 +121,9 @@
   	basename = prefix = var = null;
   	scope = PageContext.PAGE_SCOPE;
       }
  -
   
  -   //*********************************************************************
  +    
  +    //*********************************************************************
       // Tag attributes known at translation time
   
       public void setVar(String var) {
  @@ -134,12 +131,9 @@
       }
   
       public void setScope(String scope) {
  -	if (REQUEST_STRING.equalsIgnoreCase(scope))
  -	    this.scope = PageContext.REQUEST_SCOPE;
  -	else if (SESSION_STRING.equalsIgnoreCase(scope))
  -	    this.scope = PageContext.SESSION_SCOPE;
  +	this.scope = Util.getScope(scope);
       }
  -
  +    
   
       //*********************************************************************
       // Collaboration with subtags
  @@ -160,9 +154,9 @@
       public int doEndTag() throws JspException {
   	if (var != null) {
   	    if (bundle != null)
  -		pageContext.setAttribute(var, bundle);
  +		pageContext.setAttribute(var, bundle, scope);
   	    else
  -		pageContext.setAttribute(var, emptyResourceBundle);
  +		pageContext.setAttribute(var, emptyResourceBundle, scope);
   	} else if (getBodyContent() == null) {
   	    /*
   	     * If no 'var' attribute and no body, we store our base name
  @@ -181,24 +175,26 @@
   
   
       //*********************************************************************
  -    // Package-scoped utility methods
  -
  -    /*
  +    // Public utility methods
  +    
  +    /**
        * Gets the resource bundle with the given base name.
        *
        * <p> The resource bundle's locale is determined as follows:
        *
        * <ul>
        * <li> If the <tt>javax.servlet.jsp.jsptl.i18n.locale</tt> scoped 
  -     * attribute is given, use its locale.
  +     * attribute exists, use the locale stored as its value.
        *
  -     * <li> Compare the client's preferred locales (in order of preference)
  -     * against the available locales for the given base name, and use the best
  -     * matching locale.
  +     * <li> Otherwise, compare the client's preferred locales (in order of
  +     * preference) against the available locales for the given base name, and
  +     * use the best matching locale.
        *
  -     * <li> If no match is found, use the fallback locale.
  +     * <li> If no match is found, use the fallback locale given by the
  +     * <tt>javax.servlet.jsp.jsptl.i18n.fallbackLocale</tt> scoped attribute,
  +     * if it exists.
        *
  -     * <li> If no fallback locale exists, use the runtime's default locale.
  +     * <li> Otherwise, use the runtime's default locale.
        * </ul>
        *
        * @param pageContext the page in which the resource bundle with the
  @@ -208,10 +204,11 @@
        * @return the resource bundle with the given base name, or <tt>null</tt>
        * if no such resource bundle exists
        */
  -    static ResourceBundle getBundle(PageContext pageContext, String basename) {
  +    public static ResourceBundle getBundle(PageContext pageContext,
  +					   String basename) {
   	Locale loc = null;
   	ResourceBundle ret = null;
  -
  +	    
   	try {
   	    loc = (Locale)
   		pageContext.findAttribute(LocaleSupport.LOCALE_ATTRIBUTE);
  @@ -239,11 +236,11 @@
   	} catch (MissingResourceException mre) {
   	    // do nothing
   	}
  -
  +	
   	return ret;
       }
   
  -    /*
  +    /**
        * Gets the resource bundle with the default base name.
        *
        * <p> The default base name is defined by the
  @@ -257,8 +254,8 @@
        * defined in any of the scopes, or no resource bundle with the default
        * base name exists
        */
  -    static ResourceBundle getDefaultBundle(PageContext pageContext) {
  -
  +    public static ResourceBundle getDefaultBundle(PageContext pageContext) {
  +	
   	ResourceBundle ret = null;
   
   	String defaultBasename = (String)
  @@ -287,7 +284,7 @@
        * given base name. This is considered an exact match.
        *
        * <p> If no exact match exists, the first client locale that matches 
  -     * (just) the language component of an available locale is chosen.
  +     * (just) the language component of an available locale is used.
        *
        * <p> If still no match is found, <tt>null</tt> is returned.
        *
  @@ -304,9 +301,9 @@
       private static ResourceBundle getBestMatch(PageContext pageContext,
   					       String basename)
   	throws MissingResourceException {
  -
  +	
   	ResourceBundle ret = null;
  -
  +	
   	// Determine locale from client's browser settings.
   	for (Enumeration enum = pageContext.getRequest().getLocales();
   	     enum.hasMoreElements(); ) {
  
  
  
  1.2       +8 -1      jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tag/common/FormatDateSupport.java
  
  Index: FormatDateSupport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tag/common/FormatDateSupport.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FormatDateSupport.java	2001/11/16 00:20:07	1.1
  +++ FormatDateSupport.java	2001/11/17 00:18:07	1.2
  @@ -108,7 +108,9 @@
       private int dateStyle;                       // 'dateStyle' attribute
       private int timeStyle;                       // 'timeStyle' attribute
       private String var;                          // 'var' attribute
  +    private int scope;                           // 'scope' attribute
   
  +
       //*********************************************************************
       // Constructor and initialization
   
  @@ -123,6 +125,7 @@
   	timeZone = null;
   	type = DATE_TYPE;
   	dateStyle = timeStyle = DateFormat.DEFAULT;
  +	scope = PageContext.PAGE_SCOPE;
       }
   
   
  @@ -148,6 +151,10 @@
           this.var = var;
       }
   
  +    public void setScope(String scope) {
  +	this.scope = Util.getScope(scope);
  +    }
  +
   
       //*********************************************************************
       // Tag logic
  @@ -226,7 +233,7 @@
   
   	String formatted = formatter.format(value);
   	if (var != null) {
  -	    pageContext.setAttribute(var, formatted);	
  +	    pageContext.setAttribute(var, formatted, scope);	
   	} else {
   	    try {
   		pageContext.getOut().print(formatted);
  
  
  
  1.2       +7 -1      jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tag/common/FormatNumberSupport.java
  
  Index: FormatNumberSupport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tag/common/FormatNumberSupport.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FormatNumberSupport.java	2001/11/16 00:20:07	1.1
  +++ FormatNumberSupport.java	2001/11/17 00:18:07	1.2
  @@ -99,6 +99,7 @@
   
       private int type;                            // 'type' attribute
       private String var;                          // 'var' attribute
  +    private int scope;                           // 'scope' attribute
   
   
       //*********************************************************************
  @@ -113,6 +114,7 @@
   	pattern = var = null;
   	value = null;
   	type = NUMBER_TYPE;
  +	scope = PageContext.PAGE_SCOPE;
       }
   
   
  @@ -130,6 +132,10 @@
           this.var = var;
       }
   
  +    public void setScope(String scope) {
  +	this.scope = Util.getScope(scope);
  +    }
  +
   
       //*********************************************************************
       // Tag logic
  @@ -175,7 +181,7 @@
   
   	String formatted = formatter.format(value);
   	if (var != null) {
  -	    pageContext.setAttribute(var, formatted);	
  +	    pageContext.setAttribute(var, formatted, scope);	
   	} else {
   	    try {
   		pageContext.getOut().print(formatted);
  
  
  
  1.2       +1 -7      jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tag/common/LocaleSupport.java
  
  Index: LocaleSupport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tag/common/LocaleSupport.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LocaleSupport.java	2001/11/16 00:20:07	1.1
  +++ LocaleSupport.java	2001/11/17 00:18:07	1.2
  @@ -82,10 +82,7 @@
       private static final char HYPHEN = '-';
       private static final char UNDERSCORE = '_';
   
  -    private static final String REQUEST_STRING = "request";   // request scope
  -    private static final String SESSION_STRING = "session";   // session scope
   
  -
       //*********************************************************************
       // Protected state
   
  @@ -117,10 +114,7 @@
       // Tag attributes known at translation time
   
       public void setScope(String scope) {
  -	if (REQUEST_STRING.equalsIgnoreCase(scope))
  -	    this.scope = PageContext.REQUEST_SCOPE;
  -	else if (SESSION_STRING.equalsIgnoreCase(scope))
  -	    this.scope = PageContext.SESSION_SCOPE;
  +	this.scope = Util.getScope(scope);
       }
   
   
  
  
  
  1.2       +7 -1      jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tag/common/MessageFormatSupport.java
  
  Index: MessageFormatSupport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tag/common/MessageFormatSupport.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MessageFormatSupport.java	2001/11/16 00:20:07	1.1
  +++ MessageFormatSupport.java	2001/11/17 00:18:07	1.2
  @@ -81,6 +81,7 @@
       // Private state
   
       private String var;                                  // 'var' attribute
  +    private int scope;                                   // 'scope' attribute
       private List arguments;
   
   
  @@ -95,6 +96,7 @@
   
       private void init() {
   	value = var = null;
  +	scope = PageContext.PAGE_SCOPE;
   	arguments.clear();
       }
   
  @@ -106,6 +108,10 @@
           this.var = var;
       }
   
  +    public void setScope(String scope) {
  +	this.scope = Util.getScope(scope);
  +    }
  +
   
       //*********************************************************************
       // Collaboration with subtags
  @@ -133,7 +139,7 @@
   	}
   
   	if (var != null) {
  -	    pageContext.setAttribute(var, message);	
  +	    pageContext.setAttribute(var, message, scope);	
   	} else {
   	    try {
   		pageContext.getOut().print(message);
  
  
  
  1.2       +16 -5     jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tag/common/MessageSupport.java
  
  Index: MessageSupport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tag/common/MessageSupport.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MessageSupport.java	2001/11/16 00:20:07	1.1
  +++ MessageSupport.java	2001/11/17 00:18:07	1.2
  @@ -72,9 +72,9 @@
   public abstract class MessageSupport extends BodyTagSupport {
   
       //*********************************************************************
  -    // Private constants
  +    // Public constants
   
  -    private static final String UNKNOWN_KEY = "???";
  +    public static final String UNKNOWN_KEY = "???";
   
   
       //*********************************************************************
  @@ -82,11 +82,17 @@
   
       protected String key;                              // 'key' attribute
       protected ResourceBundle bundle;                   // 'bundle' attribute
  -    protected String var;                              // 'var' attribute
  -    protected List arguments;
   
   
       //*********************************************************************
  +    // Private state
  +
  +    private String var;                                // 'var' attribute
  +    private int scope;                                 // 'scope' attribute
  +    private List arguments;
  +
  +
  +    //*********************************************************************
       // Constructor and initialization
   
       public MessageSupport() {
  @@ -98,6 +104,7 @@
       private void init() {
   	key = var = null;
   	bundle = null;
  +	scope = PageContext.PAGE_SCOPE;
   	arguments.clear();
       }
   
  @@ -109,6 +116,10 @@
           this.var = var;
       }
   
  +    public void setScope(String scope) {
  +	this.scope = Util.getScope(scope);
  +    }
  +
   
       //*********************************************************************
       // Collaboration with subtags
  @@ -156,7 +167,7 @@
   	}
   
   	if (var != null) {
  -	    pageContext.setAttribute(var, message);	
  +	    pageContext.setAttribute(var, message, scope);	
   	} else {
   	    try {
   		pageContext.getOut().print(message);
  
  
  
  1.2       +7 -1      jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tag/common/ParseDateSupport.java
  
  Index: ParseDateSupport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tag/common/ParseDateSupport.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ParseDateSupport.java	2001/11/16 00:20:07	1.1
  +++ ParseDateSupport.java	2001/11/17 00:18:07	1.2
  @@ -83,6 +83,7 @@
   
       private int type;                            // 'type' attribute
       private String var;                          // 'var' attribute
  +    private int scope;                           // 'scope' attribute
   
   
       //*********************************************************************
  @@ -96,6 +97,7 @@
       private void init() {
   	value = pattern = var = null;
   	type = FormatDateSupport.DATE_TYPE;
  +	scope = PageContext.PAGE_SCOPE;
       }
   
   
  @@ -113,6 +115,10 @@
           this.var = var;
       }
   
  +    public void setScope(String scope) {
  +	this.scope = Util.getScope(scope);
  +    }
  +
   
       //*********************************************************************
       // Tag logic
  @@ -155,7 +161,7 @@
   	}
   
   	if (var != null) {
  -	    pageContext.setAttribute(var, parsed);	
  +	    pageContext.setAttribute(var, parsed, scope);	
   	} else {
   	    try {
   		pageContext.getOut().print(parsed);
  
  
  
  1.2       +7 -1      jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tag/common/ParseNumberSupport.java
  
  Index: ParseNumberSupport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tag/common/ParseNumberSupport.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ParseNumberSupport.java	2001/11/16 00:20:07	1.1
  +++ ParseNumberSupport.java	2001/11/17 00:18:07	1.2
  @@ -83,6 +83,7 @@
   
       private int type;                            // 'type' attribute
       private String var;                          // 'var' attribute
  +    private int scope;                           // 'scope' attribute
   
   
       //*********************************************************************
  @@ -96,6 +97,7 @@
       private void init() {
   	value = pattern = var = null;
   	type = FormatNumberSupport.NUMBER_TYPE;
  +	scope = PageContext.PAGE_SCOPE;
       }
   
   
  @@ -113,6 +115,10 @@
           this.var = var;
       }
   
  +    public void setScope(String scope) {
  +	this.scope = Util.getScope(scope);
  +    }
  +
   
       //*********************************************************************
       // Tag logic
  @@ -149,7 +155,7 @@
   	}
   
   	if (var != null) {
  -	    pageContext.setAttribute(var, parsed);	
  +	    pageContext.setAttribute(var, parsed, scope);	
   	} else {
   	    try {
   		pageContext.getOut().print(parsed);
  
  
  
  1.2       +2 -12     jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tag/common/TimeZoneSupport.java
  
  Index: TimeZoneSupport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tag/common/TimeZoneSupport.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TimeZoneSupport.java	2001/11/16 00:20:07	1.1
  +++ TimeZoneSupport.java	2001/11/17 00:18:07	1.2
  @@ -77,13 +77,6 @@
   
   
       //*********************************************************************
  -    // Private constants
  -
  -    private static final String REQUEST_STRING = "request";   // request scope
  -    private static final String SESSION_STRING = "session";   // session scope
  -
  -
  -    //*********************************************************************
       // Protected state
   
       protected String value;                      // 'value' attribute
  @@ -119,10 +112,7 @@
       }
   
       public void setScope(String scope) {
  -	if (REQUEST_STRING.equalsIgnoreCase(scope))
  -	    this.scope = PageContext.REQUEST_SCOPE;
  -	else if (SESSION_STRING.equalsIgnoreCase(scope))
  -	    this.scope = PageContext.SESSION_SCOPE;
  +	this.scope = Util.getScope(scope);
       }
   
   
  @@ -144,7 +134,7 @@
   
       public int doEndTag() throws JspException {
   	if (var != null) {
  -	    pageContext.setAttribute(var, timeZone);	
  +	    pageContext.setAttribute(var, timeZone, scope);	
   	} else if (getBodyContent() == null) {
   	    /*
   	     * If no 'var' attribute and no body, we store our time zone
  
  
  
  1.1                  jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tag/common/Util.java
  
  Index: Util.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.jsptl.tag.common;
  
  import javax.servlet.jsp.*;
  
  /**
   * <p>Utilities in support of (Body)TagSupport classes.</p>
   *
   * @author Jan Luehe
   */
  public class Util {
  
      private static final String REQUEST_STRING = "request";   
      private static final String SESSION_STRING = "session";   
      private static final String APPLICATION_STRING = "application"; 
  
      public static int getScope(String scope) {
  	int ret = PageContext.PAGE_SCOPE; // default
  
  	if (REQUEST_STRING.equalsIgnoreCase(scope))
  	    ret = PageContext.REQUEST_SCOPE;
  	else if (SESSION_STRING.equalsIgnoreCase(scope))
  	    ret = PageContext.SESSION_SCOPE;
  	else if (APPLICATION_STRING.equalsIgnoreCase(scope))
  	    ret = PageContext.APPLICATION_SCOPE;
  
  	return ret;
      }
  }
  
  
  
  1.2       +1 -18     jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tei/BundleTEI.java
  
  Index: BundleTEI.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tei/BundleTEI.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BundleTEI.java	2001/11/16 00:20:08	1.1
  +++ BundleTEI.java	2001/11/17 00:18:07	1.2
  @@ -65,27 +65,10 @@
    */
   public class BundleTEI extends TagExtraInfo {
   
  -    private static final String SCOPE_ATTRIBUTE = "scope";  
  -    private static final String PAGE_STRING = "page";         // page scope
  -    private static final String REQUEST_STRING = "request";   // request scope
  -    private static final String SESSION_STRING = "session";   // session scope
  -
       /**
        * Validates the <tt>scope</tt> attribute of the &lt;bundle&gt; tag.
        */
       public boolean isValid(TagData data) {
  -	return isValidScope(data);
  -    }
  -
  -    static boolean isValidScope(TagData data) {
  -        String scope = data.getAttributeString(SCOPE_ATTRIBUTE);
  -
  -	if ((scope != null)
  -	    && !scope.equals(PAGE_STRING)
  -	    && !scope.equals(REQUEST_STRING)
  -	    && !scope.equals(SESSION_STRING))
  -	    return false;
  -
  -        return true;
  +	return Util.isValidScope(data);
       }
   }
  
  
  
  1.2       +7 -0      jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tei/FormatDateTEI.java
  
  Index: FormatDateTEI.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tei/FormatDateTEI.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FormatDateTEI.java	2001/11/16 00:20:08	1.1
  +++ FormatDateTEI.java	2001/11/17 00:18:07	1.2
  @@ -92,6 +92,9 @@
           return true;
       }
   
  +    /*
  +     * Returns true if the 'type' attribute is valid.
  +     */
       static boolean isValidType(TagData data) {
   	String type = data.getAttributeString(TYPE_ATTRIBUTE);
   	if ((type != null)
  @@ -102,6 +105,10 @@
   	return true;
       }
   
  +    /*
  +     * Returns true if the given 'timeStyle' or 'dateStyle' attribute is
  +     * present.
  +     */
       private boolean isValidStyle(String style) {
   	if ((style != null)
   	    && !style.equals(FormatDateSupport.DEFAULT_STYLE)
  
  
  
  1.2       +3 -0      jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tei/FormatNumberTEI.java
  
  Index: FormatNumberTEI.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tei/FormatNumberTEI.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FormatNumberTEI.java	2001/11/16 00:20:08	1.1
  +++ FormatNumberTEI.java	2001/11/17 00:18:07	1.2
  @@ -87,6 +87,9 @@
   	return isValidFormatNumber(data);
       }
   
  +    /*
  +     * Returns true if the 'type' and 'pattern' attributes are valid.
  +     */
       static boolean isValidFormatNumber(TagData data) {
           String type = data.getAttributeString(TYPE_ATTRIBUTE);
   	if (type != null) {
  
  
  
  1.2       +1 -1      jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tei/LocaleTEI.java
  
  Index: LocaleTEI.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tei/LocaleTEI.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LocaleTEI.java	2001/11/16 00:20:08	1.1
  +++ LocaleTEI.java	2001/11/17 00:18:07	1.2
  @@ -69,6 +69,6 @@
        * Validates the <tt>scope</tt> attribute of the &lt;locale&gt; tag.
        */
       public boolean isValid(TagData data) {
  -	return BundleTEI.isValidScope(data);
  +	return Util.isValidScope(data);
       }
   }
  
  
  
  1.2       +1 -1      jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tei/TimeZoneTEI.java
  
  Index: TimeZoneTEI.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tei/TimeZoneTEI.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TimeZoneTEI.java	2001/11/16 00:20:08	1.1
  +++ TimeZoneTEI.java	2001/11/17 00:18:07	1.2
  @@ -69,6 +69,6 @@
        * Validates the <tt>scope</tt> attribute of the &lt;timeZone&gt; tag.
        */
       public boolean isValid(TagData data) {
  -	return BundleTEI.isValidScope(data);
  +	return Util.isValidScope(data);
       }
   }
  
  
  
  1.2       +17 -0     jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tei/Util.java
  
  Index: Util.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tei/Util.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Util.java	2001/10/25 23:12:57	1.1
  +++ Util.java	2001/11/17 00:18:07	1.2
  @@ -64,9 +64,26 @@
    */
   public class Util {
   
  +    private static final String SCOPE_ATTRIBUTE = "scope";  
  +    private static final String PAGE_SCOPE = "page";        
  +    private static final String REQUEST_SCOPE = "request";  
  +    private static final String SESSION_SCOPE = "session";  
  +
       // returns true if the given attribute name is specified, false otherwise
       public static boolean isSpecified(TagData data, String attributeName) {
           return (data.getAttribute(attributeName) != null);
       }
   
  +    // returns true if the 'scope' attribute is valid
  +    public static boolean isValidScope(TagData data) {
  +        String scope = data.getAttributeString(SCOPE_ATTRIBUTE);
  +
  +	if ((scope != null)
  +	    && !scope.equals(PAGE_SCOPE)
  +	    && !scope.equals(REQUEST_SCOPE)
  +	    && !scope.equals(SESSION_SCOPE))
  +	    return false;
  +
  +        return true;
  +    }
   }
  
  
  
  1.1                  jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tei/MessageFormatTEI.java
  
  Index: MessageFormatTEI.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.jsptl.tei;
  
  import javax.servlet.jsp.tagext.*;
  
  /**
   * An implementation of TagExtraInfo that implements validation for
   * &lt;messageFormat&gt; tag's attributes.
   *
   * @author Jan Luehe
   */
  public class MessageFormatTEI extends TagExtraInfo {
  
      /**
       * Validates the <tt>scope</tt> attribute of the &lt;messageFormat&gt; tag.
       */
      public boolean isValid(TagData data) {
  	return Util.isValidScope(data);
      }
  }
  
  
  
  1.1                  jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tei/MessageTEI.java
  
  Index: MessageTEI.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.jsptl.tei;
  
  import javax.servlet.jsp.tagext.*;
  
  /**
   * An implementation of TagExtraInfo that implements validation for
   * &lt;message&gt; tag's attributes.
   *
   * @author Jan Luehe
   */
  public class MessageTEI extends TagExtraInfo {
  
      /**
       * Validates the <tt>scope</tt> attribute of the &lt;message&gt; tag.
       */
      public boolean isValid(TagData data) {
  	return Util.isValidScope(data);
      }
  }
  
  
  

--
To unsubscribe, e-mail:   <mailto:taglibs-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-dev-help@jakarta.apache.org>


Mime
View raw message