jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gl...@apache.org
Subject cvs commit: jakarta-taglibs/i18n/xml i18n.xml
Date Tue, 17 Dec 2002 04:19:00 GMT
glenn       2002/12/16 20:19:00

  Modified:    i18n/src/org/apache/taglibs/i18n BundleTEI.java
                        BundleTag.java FormatCurrencyTEI.java
                        FormatCurrencyTag.java FormatDateTEI.java
                        FormatDateTag.java FormatDateTagSupport.java
                        FormatDateTimeTEI.java FormatDateTimeTag.java
                        FormatNumberTEI.java FormatNumberTag.java
                        FormatPercentTEI.java FormatPercentTag.java
                        FormatStringTEI.java FormatStringTag.java
                        FormatTagSupport.java FormatTimeTEI.java
                        FormatTimeTag.java LocaleTEI.java LocaleTag.java
                        MessageTEI.java MessageTag.java
               i18n/xml i18n.xml
  Log:
  Number bugzilla bug fixes, especially for bugs related to use of
  the i18n taglib in JSP containers which implement custom tag pooling.
  
  Revision  Changes    Path
  1.2       +105 -65   jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/BundleTEI.java
  
  Index: BundleTEI.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/BundleTEI.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BundleTEI.java	13 Jun 2001 03:24:41 -0000	1.1
  +++ BundleTEI.java	17 Dec 2002 04:18:59 -0000	1.2
  @@ -1,65 +1,105 @@
  -/*
  - *
  - * Copyright (c) 1999,2000,2001 WAM!NET Professional Services, LLC
  - * All Rights Reserved.
  - *
  - *
  - */
  -
  -package org.apache.taglibs.i18n;
  -
  -import javax.servlet.jsp.tagext.TagData;
  -import javax.servlet.jsp.tagext.TagExtraInfo;
  -import javax.servlet.jsp.tagext.VariableInfo;
  -
  -
  -/**
  - * Defines the possible JSP beans available within the the body
  - * of the iterator tag.
  - */
  -public class BundleTEI extends TagExtraInfo
  -  {
  -
  -  /**
  -   * Standard no-arg constructor. No actions performed.
  -   */
  -  public BundleTEI()
  -    {
  -    super();
  -    }
  -
  -  /**
  -   * Returns two VariableInfo objects that define the following
  -   * body objects
  -   * <UL>
  -   * <LI>A variable that represents the current value of the iterator.
  -   * The name to reference this object is defined in the iterator tag
  -   * with the value "varName". The type of this object is defined by
  -   * the "varType" value passed in the iterator tag.
  -   * </UL>
  -   *
  -   * @param data a value of type 'TagData'
  -   * @return a value of type 'VariableInfo[]'
  -   */
  -  public VariableInfo[] getVariableInfo( TagData data )
  -    {
  -    String varName = data.getAttributeString("id");
  -    if ( varName == null )
  -        {
  -        return new VariableInfo[]
  -                    {
  -                    };
  -        }
  -    else
  -        {
  -        return new VariableInfo[]
  -                    {
  -                    new VariableInfo( varName,
  -                                      "java.util.ResourceBundle",
  -                                      true,
  -                                      VariableInfo.AT_BEGIN ),
  -                    };
  -        }
  -    }
  -
  -  } // BundleTEI
  +/*
  + * $Header$
  + * $Revision$
  + * $Date$
  + *
  + * ====================================================================
  + *
  + * 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.i18n;
  +
  +import javax.servlet.jsp.tagext.TagData;
  +import javax.servlet.jsp.tagext.TagExtraInfo;
  +import javax.servlet.jsp.tagext.VariableInfo;
  +
  +
  +/**
  + * Defines the possible JSP beans available within the the body
  + * of the iterator tag.
  + */
  +public class BundleTEI extends TagExtraInfo
  +{
  +
  +    /**
  +     * Returns two VariableInfo objects that define the following
  +     * body objects
  +     * <UL>
  +     * <LI>A variable that represents the current value of the iterator.
  +     * The name to reference this object is defined in the iterator tag
  +     * with the value "varName". The type of this object is defined by
  +     * the "varType" value passed in the iterator tag.
  +     * </UL>
  +     *
  +     * @param data a value of type 'TagData'
  +     * @return a value of type 'VariableInfo[]'
  +     */
  +    public VariableInfo[] getVariableInfo( TagData data )
  +    {
  +        String varName = data.getAttributeString("id");
  +        if ( varName == null ) {
  +            return new VariableInfo[] {
  +            };
  +        } else {
  +            return new VariableInfo[] {
  +                new VariableInfo( varName,
  +                                  "java.util.ResourceBundle",
  +                                  true,
  +                                  VariableInfo.AT_BEGIN ),
  +            };
  +        }
  +    }
  +
  +}
  
  
  
  1.7       +235 -262  jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/BundleTag.java
  
  Index: BundleTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/BundleTag.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- BundleTag.java	19 Jan 2002 07:43:52 -0000	1.6
  +++ BundleTag.java	17 Dec 2002 04:18:59 -0000	1.7
  @@ -73,6 +73,7 @@
   import javax.servlet.http.HttpSession;
   
   import javax.servlet.jsp.JspException;
  +import javax.servlet.jsp.JspTagException;
   import javax.servlet.jsp.PageContext;
   import javax.servlet.jsp.tagext.Tag;
   import javax.servlet.jsp.tagext.TagSupport;
  @@ -96,299 +97,271 @@
    *  @author <a href="mailto:tdawson@wamnet.com">Tim Dawson</a>
    */
   public class BundleTag extends TagSupport
  -  {
  -  private String         _baseName = null;
  -  private String         _localeAttribute = null;
  -  private Locale         _locale = null;
  -  private boolean        _changeResponseLocale = true;
  -  private ResourceBundle _bundle = null;
  -  private int            _scope = PageContext.PAGE_SCOPE;
  -  private boolean        _debug = false;
  -  
  -  /**
  -   *  Sets the baseName of the bundle that the MessageTags will use when
  -   *  retrieving keys for this page.
  -   */
  -  public void setBaseName(String value)
  -    {
  -    _baseName = value;
  -    }
  -
  -  /**
  -   *  Set to true to enable debug logging.
  -   */
  -  public void setDebug(boolean value)
  -    {
  -    _debug = value;
  -    }
  +{
  +    private String         _baseName = null;
  +    private String         _localeAttribute = null;
  +    private Locale         _locale = null;
  +    private boolean        _changeResponseLocale = true;
  +    private ResourceBundle _bundle = null;
  +    private int            _scope = PageContext.PAGE_SCOPE;
  +    private boolean        _debug = false;
       
  -  /**
  -   *  Sets the locale of the bundle that the MessageTags will use when
  -   *  retrieving keys for this page.
  -   */
  -  public void setLocale(Locale value)
  -    {
  -    _locale = value;
  -    }
  -
  -  /**
  -   *  Provides a key to search the page context for in order to get the
  -   *  locale of the bundle that the MessageTags will use when retrieving
  -   *  keys for this page.
  -   *  @deprecated
  -   */
  -  public void setLocaleAttribute(String value)
  -    {
  -    _localeAttribute = value;
  -    }
  -
  -  /**
  -   *  Provides a key to search the page context for in order to get the
  -   *  locale of the bundle that the MessageTags will use when retrieving
  -   *  keys for this page.
  -   */
  -  public void setLocaleRef(String value)
  +    /**
  +     *  Sets the baseName of the bundle that the MessageTags will use when
  +     *  retrieving keys for this page.
  +     */
  +    public final void setBaseName(String value)
  +    {
  +        _baseName = value;
  +    }
  +
  +    /**
  +     *  Set to true to enable debug logging.
  +     */
  +    public final void setDebug(boolean value)
  +    {
  +        _debug = value;
  +    }
  +      
  +      /**
  +       *  Sets the locale of the bundle that the MessageTags will use when
  +       *  retrieving keys for this page.
  +       */
  +      public void setLocale(Locale value)
  +      {
  +          _locale = value;
  +      }
  +
  +    /**
  +     *  Provides a key to search the page context for in order to get the
  +     *  locale of the bundle that the MessageTags will use when retrieving
  +     *  keys for this page.
  +     *  @deprecated
  +     */
  +    public void setLocaleAttribute(String value)
  +    {
  +        _localeAttribute = value;
  +    }
  +
  +    /**
  +     *  Provides a key to search the page context for in order to get the
  +     *  locale of the bundle that the MessageTags will use when retrieving
  +     *  keys for this page.
  +     */
  +    public void setLocaleRef(String value)
  +    {
  +        _localeAttribute = value;
  +    }
  +
  +    /**
  +     *  Sets the scope that the bundle will be available to message tags.
  +     *  By default page scope is used.
  +     */
  +    public void setScope(String value) throws JspException
       {
  -    _localeAttribute = value;
  +        if (value == null)
  +            {
  +            throw new JspTagException("i18n:bundle tag invalid scope attribute of null");
  +            }
  +        else if (value.toLowerCase().equals("application"))
  +            {
  +            _scope = PageContext.APPLICATION_SCOPE;
  +            }
  +        else if (value.toLowerCase().equals("session"))
  +            {
  +            _scope = PageContext.SESSION_SCOPE;
  +            }
  +        else if (value.toLowerCase().equals("request"))
  +            {
  +            _scope = PageContext.REQUEST_SCOPE;
  +            }
  +        else if (value.toLowerCase().equals("page"))
  +            {
  +            _scope = PageContext.PAGE_SCOPE;
  +            }
  +        else
  +            {
  +            throw new JspTagException("i18n:bundle tag invalid scope attribute=" + value);
  +            }
       }
   
  -  /**
  -   *  Sets the scope that the bundle will be available to message tags.
  -   *  By default page scope is used.
  -   */
  -  public void setScope(String value)
  -    {
  -    if (value == null)
  -        {
  -        throw new NullPointerException("setScope requires a non-null value");
  -        }
  -    else if (value.toLowerCase().equals("application"))
  -        {
  -        _scope = PageContext.APPLICATION_SCOPE;
  -        }
  -    else if (value.toLowerCase().equals("session"))
  -        {
  -        _scope = PageContext.SESSION_SCOPE;
  -        }
  -    else if (value.toLowerCase().equals("request"))
  -        {
  -        _scope = PageContext.REQUEST_SCOPE;
  -        }
  -    else if (value.toLowerCase().equals("page"))
  -        {
  +    /**
  +     *  Specifies whether or not the response locale should be changed to match
  +     *  the locale used by this tag.
  +     */
  +    public void setChangeResponseLocale(boolean value)
  +    {
  +        _changeResponseLocale = value;
  +    }
  +
  +    public void release()
  +    {
  +        super.release();
  +        _baseName = null;
  +        _localeAttribute = null;
  +        _locale = null;
  +        _changeResponseLocale = true;
  +        _bundle = null;
           _scope = PageContext.PAGE_SCOPE;
  -        }
  -    else
  -        {
  -        throw new RuntimeException("bundle tag received invalid scope");
  -        }
  +        _debug = false;
       }
   
  -  /**
  -   *  Specifies whether or not the response locale should be changed to match
  -   *  the locale used by this tag.
  -   */
  -  public void setChangeResponseLocale(boolean value)
  -    {
  -    _changeResponseLocale = value;
  -    }
  -
  -  public void release()
  -    {
  -    super.release();
  -    _baseName = null;
  -    _localeAttribute = null;
  -    _locale = null;
  -    _changeResponseLocale = true;
  -    _bundle = null;
  -    _scope = PageContext.PAGE_SCOPE;
  -    _debug = false;
  -    }
  -
  -  /**
  -   *  Returns the bundle specified by the tag.  This will not be initialized
  -   *  until after doStartTag() is called.
  -   */
  -  public ResourceBundle getBundle()
  -    {
  -    return _bundle;
  -    }
  -
  -  /**
  -   *  Locates and prepares a ResourceBundle for use within this request by
  -   *  message tags.  The bundle is located as specified by the given bundle
  -   *  name and the user's browser locale settings. The first preferred
  -   *  locale available that matches at least on basis of language is
  -   *  used. If an exact match is found for both locale and country, it is used.
  -   *
  -   *  Once a preferred locale has been determined for the given bundle name,
  -   *  the locale is cached in the user's session, so that the above computation
  -   *  can be avoided the next time the user requests a page with this bundle.
  -   *  (The entire bundle could be cached in the session, but large bundles would
  -   *  be problematic in servlet containers that serialize the session to provide
  -   *  clustering.)
  -   */
  -  private void findBundle()
  -          throws JspException
  -    {
  -    // the bundle name is required. if not provided, throw an exception
  -    if (_baseName == null)
  -        {
  -        throw new JspException("A baseName must be specified.");
  -        }
  -
  -    // if locale not provided, but an attribute was, search for it
  -    if (_locale == null && _localeAttribute != null)
  -        {
  -        _locale = (Locale)pageContext.findAttribute(_localeAttribute);
  -        }
  -    
  -    // if we now have a locale, grab the resource bundle
  -    if (_locale != null)
  -        {
  -        _bundle = ResourceBundle.getBundle(_baseName,_locale);
  -        if (_debug) 
  -            {
  -            ServletContext sc = pageContext.getServletContext();
  -            sc.log("i18n: debug: found locale " + _locale);
  +    /**
  +     * Get the bundle created by this bundle tag, used by nested tags.
  +     *
  +     * @return ResourceBundle bundle
  +     */
  +    protected final ResourceBundle getBundle()
  +    {
  +        return _bundle;
  +    }
  +
  +    /**
  +     *  Locates and prepares a ResourceBundle for use within this request by
  +     *  message tags.  The bundle is located as specified by the given bundle
  +     *  name and the user's browser locale settings. The first preferred
  +     *  locale available that matches at least on basis of language is
  +     *  used. If an exact match is found for both locale and country, it is used.
  +     *
  +     *  Once a preferred locale has been determined for the given bundle name,
  +     *  the locale is cached in the user's session, so that the above computation
  +     *  can be avoided the next time the user requests a page with this bundle.
  +     *  (The entire bundle could be cached in the session, but large bundles would
  +     *  be problematic in servlet containers that serialize the session to provide
  +     *  clustering.)
  +     */
  +    private void findBundle() throws JspException
  +    {
  +        // the bundle name is required. if not provided, throw an exception
  +        if (_baseName == null) {
  +            throw new JspTagException(
  +                "i18n:bundle tag, a baseName attribute must be specified.");
  +        }
  +
  +        // if locale not provided, but an attribute was, search for it
  +        if (_locale == null && _localeAttribute != null) {
  +            _locale = (Locale)pageContext.findAttribute(_localeAttribute);
  +        }
  +
  +        // if we now have a locale, grab the resource bundle
  +        ClassLoader cl = Thread.currentThread().getContextClassLoader();
  +        if (_locale != null) {
  +            _bundle = ResourceBundle.getBundle(_baseName,_locale,cl);
  +            if (_debug) {
  +                ServletContext sc = pageContext.getServletContext();
  +                sc.log("i18n:bundle tag debug: found locale " + _locale);
               }
           }
  -    
  -    // attempt to load the bundle and compute the locale by looping through
  -    // the browser's preferred locales; cache the final locale for future use
  -    else
  -        {
  -        Enumeration localeEnumerator = pageContext.getRequest().getLocales();
  -        while (localeEnumerator.hasMoreElements())
  -            {
  -            _locale = (Locale)localeEnumerator.nextElement();
  -
  -            if (_debug)
  -                {
  -                ServletContext sc = pageContext.getServletContext();
  -                sc.log("i18n: debug: enumerating locale = " + _locale);    
  -                }
  -                
  -            // get a bundle and see whether it has a good locale
  -            ResourceBundle test = ResourceBundle.getBundle(_baseName,
  -                                                           _locale);
  -            String language = test.getLocale().getLanguage();
  -            String country = test.getLocale().getCountry();
  -
  -            // if the requested locale isn't available, the above call will
  -            // return a bundle with a locale for the same language, or will
  -            // return the default locale, so we need to compare the locale
  -            // of the bundle we got back with the one we asked for
  -            if (test.getLocale().equals(_locale))
  -                {
  -                // exactly what we were looking for - stop here and use this
  -                _bundle = test;
  -                break;                
  +        
  +        // attempt to load the bundle and compute the locale by looping through
  +        // the browser's preferred locales; cache the final locale for future use
  +        else {
  +            Enumeration localeEnumerator = pageContext.getRequest().getLocales();
  +            while (localeEnumerator.hasMoreElements()) {
  +                _locale = (Locale)localeEnumerator.nextElement();
  +
  +                if (_debug) {
  +                    ServletContext sc = pageContext.getServletContext();
  +                    sc.log("i18n:bundle tag debug: enumerating locale = " + _locale);    
                   }
  -            else if (_locale.getLanguage().equals(language))
  -                {
  -                // the language matches; see if the country matches as well
  -                if (_locale.getCountry().equals(country))
  -                    {
  -                    // keep looking but this is a good option. it only gets
  -                    // better if the variant matches too!  (note: we will only
  -                    // get to this statement if a variant has been provided)
  +                    
  +                // get a bundle and see whether it has a good locale
  +                ResourceBundle test = 
  +                    ResourceBundle.getBundle(_baseName,_locale,cl);
  +                String language = test.getLocale().getLanguage();
  +                String country = test.getLocale().getCountry();
  +
  +                // if the requested locale isn't available, the above call will
  +                // return a bundle with a locale for the same language, or will
  +                // return the default locale, so we need to compare the locale
  +                // of the bundle we got back with the one we asked for
  +                if (test.getLocale().equals(_locale)) {
  +                    // exactly what we were looking for - stop here and use this
                       _bundle = test;
  -                    continue;
  -                    }
  -                else
  -                    {
  -                    // if we don't already have a candidate, this is a good
  -                    // one otherwise, don't change it because the current
  -                    // candidate might match the country but not the variant
  -                    if (_bundle == null)
  -                        {
  +                    break;                
  +                } else if (_locale.getLanguage().equals(language)) {
  +                    // the language matches; see if the country matches as well
  +                    if (_locale.getCountry().equals(country)) {
  +                        // keep looking but this is a good option. it only gets
  +                        // better if the variant matches too!  (note: we will only
  +                        // get to this statement if a variant has been provided)
                           _bundle = test;
  +                        continue;
  +                    } else {
  +                        // if we don't already have a candidate, this is a good
  +                        // one otherwise, don't change it because the current
  +                        // candidate might match the country but not the variant
  +                        if (_bundle == null) {
  +                             _bundle = test;
                           }
  -                    continue;
  +                        continue;
                       }
  -                }
  -            else if (_debug)
  -                {
  -                ServletContext sc = pageContext.getServletContext();
  -                sc.log("i18n: requested locale not available: " + _locale);
  +                } else if (_debug) {
  +                    ServletContext sc = pageContext.getServletContext();
  +                    sc.log("i18n:bundle tag requested locale not available: " + _locale);
                   }
               }
   
  -        // bundle should never be null at this point - if the last locale on
  -        // the list wasn't available, the default locale should have kicked
  -        // in, but I like being safe, hence the code below.
  -        if (_bundle == null)
  -            {
  -            _bundle = ResourceBundle.getBundle(_baseName);
  +            // bundle should never be null at this point - if the last locale on
  +            // the list wasn't available, the default locale should have kicked
  +            // in, but I like being safe, hence the code below.
  +            if (_bundle == null) {
  +                _bundle = ResourceBundle.getBundle(_baseName);
               }
   
  -        if (_debug)
  -            {
  -            ServletContext sc = pageContext.getServletContext();
  -            sc.log("i18n: debug: bundle (sensed locale) = " + _bundle);
  +            if (_debug) {
  +                ServletContext sc = pageContext.getServletContext();
  +                sc.log("i18n:bundle tag debug: bundle (sensed locale) = " + _bundle);
               }
  -        
  -        // if the localeAttribute was provided, but didn't have a value,
  -        // go ahead and remember the value for next time
  -        if (_localeAttribute != null)
  -            {
  -            HttpSession session = pageContext.getSession();
  -            session.setAttribute(_localeAttribute,_bundle.getLocale());
  +            
  +            // if the localeAttribute was provided, but didn't have a value,
  +            // go ahead and remember the value for next time
  +            if (_localeAttribute != null) {
  +                HttpSession session = pageContext.getSession();
  +                session.setAttribute(_localeAttribute,_bundle.getLocale());
               }
           }
   
       }
   
  -  /**
  -   *  Called upon invocation of the tag. If an id is specified, sets the
  -   *  bundle into the page context.
  -   */
  -  public int doStartTag()
  -          throws JspException
  +    /**
  +     *  Called upon invocation of the tag. If an id is specified, sets the
  +     *  bundle into the page context.
  +     */
  +    public int doStartTag() throws JspException
       {
  -    this.findBundle();
  -    
  -    if (_debug) 
  -        {
  -        ServletContext sc = pageContext.getServletContext();
  -        sc.log("i18n: debug: basename =" + _baseName);
  +        findBundle();
  +
  +        if (_debug) {
  +            ServletContext sc = pageContext.getServletContext();
  +            sc.log("i18n:bundle tag debug: basename =" + _baseName);
           }    
  -        
  -    // set the bundle as a variable in the page
  -    if (this.getId() != null)
  -        {
  -        pageContext.setAttribute(this.getId(),this.getBundle());
  +
  +        // set the bundle as a variable in the page
  +        if (this.getId() != null) {
  +            pageContext.setAttribute(this.getId(),_bundle);
           }
  -    
  -    return EVAL_BODY_INCLUDE;
  +
  +        return EVAL_BODY_INCLUDE;
       }
   
  -  /**
  -   *  Sets the response locale if changeResponseLocale attribute is true
  -   */
  -  public int doEndTag()
  -          throws JspException
  -    {
  -    if (_changeResponseLocale)
  -        {
  -        // set the locale for the response
  -        Locale bundleLocale = _bundle.getLocale();
  -        if ((bundleLocale != null) && !("".equals(bundleLocale.getLanguage())))
  -            {
  -            pageContext.getResponse().setLocale(bundleLocale);
  +    /**
  +     *  Sets the response locale if changeResponseLocale attribute is true
  +     */
  +    public int doEndTag() throws JspException
  +    {
  +        if (_changeResponseLocale) {
  +            // set the locale for the response
  +            Locale bundleLocale = _bundle.getLocale();
  +            if ((bundleLocale != null) && !("".equals(bundleLocale.getLanguage()))) {
  +                pageContext.getResponse().setLocale(bundleLocale);
               }
           }
  -    
  -    // different handling is necessary if multiple bundle tags are in use
  -    ResourceBundle firstBundle = ResourceHelper.getBundle(pageContext);
  -    if (firstBundle == null)
  -        {
  +
           // cache the bundle for use by message tags within this request
           ResourceHelper.setBundle(pageContext,_bundle,_scope);
  -        }
   
  -    return EVAL_PAGE;
  +        return EVAL_PAGE;
       }
   
  -  } // BundleTag
  +}
  
  
  
  1.2       +87 -87    jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/FormatCurrencyTEI.java
  
  Index: FormatCurrencyTEI.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/FormatCurrencyTEI.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FormatCurrencyTEI.java	16 Oct 2001 03:56:35 -0000	1.1
  +++ FormatCurrencyTEI.java	17 Dec 2002 04:18:59 -0000	1.2
  @@ -1,87 +1,87 @@
  -/*
  - * $Header$
  - * $Revision$
  - * $Date$
  - *
  - * ====================================================================
  - * 
  - * 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.i18n;
  -
  -import javax.servlet.jsp.tagext.*;
  -
  -public class FormatCurrencyTEI extends TagExtraInfo
  -{
  -  public VariableInfo [] getVariableInfo (TagData data)
  -  {
  -    String varName = data.getId();
  -    if ( varName == null )
  -    {
  -        return new VariableInfo[] {};
  -    }
  -    else
  -    {
  -        return new VariableInfo []
  -        {
  -            new VariableInfo(varName,
  -                         "java.lang.String",
  -                         true,
  -                         VariableInfo.AT_END)
  -        };
  -    }
  -  }
  -} // end of class
  -
  +/*
  + * $Header$
  + * $Revision$
  + * $Date$
  + *
  + * ====================================================================
  + * 
  + * 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.i18n;
  +
  +import javax.servlet.jsp.tagext.*;
  +
  +public class FormatCurrencyTEI extends TagExtraInfo
  +{
  +  public VariableInfo [] getVariableInfo (TagData data)
  +  {
  +    String varName = data.getId();
  +    if ( varName == null )
  +    {
  +        return new VariableInfo[] {};
  +    }
  +    else
  +    {
  +        return new VariableInfo []
  +        {
  +            new VariableInfo(varName,
  +                         "java.lang.String",
  +                         true,
  +                         VariableInfo.AT_END)
  +        };
  +    }
  +  }
  +} // end of class
  +
  
  
  
  1.3       +83 -83    jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/FormatCurrencyTag.java
  
  Index: FormatCurrencyTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/FormatCurrencyTag.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FormatCurrencyTag.java	14 Oct 2001 22:01:25 -0000	1.2
  +++ FormatCurrencyTag.java	17 Dec 2002 04:18:59 -0000	1.3
  @@ -1,83 +1,83 @@
  -/*
  - * $Header$
  - * $Revision$
  - * $Date$
  - *
  - * ====================================================================
  - * 
  - * 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.i18n;
  -
  -import java.text.Format;
  -import java.text.NumberFormat;
  -
  -/** Formats a {@link Number} instance using the current {@link java.util.Locale} 
  -  * and the Currency {@link NumberFormat}.
  -  *
  -  * @author James Strachan
  -  * @version $Revision$
  -  */
  -public class FormatCurrencyTag extends FormatTagSupport {
  -
  -    public FormatCurrencyTag() {
  -    }
  -    
  -    // Implementation methods
  -    //-------------------------------------------------------------------------
  -    protected Format getFormat() {
  -        return NumberFormat.getCurrencyInstance( getLocale() );
  -    }
  -}
  +/*
  + * $Header$
  + * $Revision$
  + * $Date$
  + *
  + * ====================================================================
  + * 
  + * 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.i18n;
  +
  +import java.text.Format;
  +import java.text.NumberFormat;
  +
  +/** Formats a {@link Number} instance using the current {@link java.util.Locale} 
  +  * and the Currency {@link NumberFormat}.
  +  *
  +  * @author James Strachan
  +  * @version $Revision$
  +  */
  +public class FormatCurrencyTag extends FormatTagSupport {
  +
  +    public FormatCurrencyTag() {
  +    }
  +    
  +    // Implementation methods
  +    //-------------------------------------------------------------------------
  +    protected Format getFormat() {
  +        return NumberFormat.getCurrencyInstance( getLocale() );
  +    }
  +}
  
  
  
  1.2       +87 -87    jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/FormatDateTEI.java
  
  Index: FormatDateTEI.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/FormatDateTEI.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FormatDateTEI.java	16 Oct 2001 03:56:35 -0000	1.1
  +++ FormatDateTEI.java	17 Dec 2002 04:18:59 -0000	1.2
  @@ -1,87 +1,87 @@
  -/*
  - * $Header$
  - * $Revision$
  - * $Date$
  - *
  - * ====================================================================
  - * 
  - * 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.i18n;
  -
  -import javax.servlet.jsp.tagext.*;
  -
  -public class FormatDateTEI extends TagExtraInfo
  -{
  -  public VariableInfo [] getVariableInfo (TagData data)
  -  {
  -    String varName = data.getId();
  -    if ( varName == null )
  -    {
  -        return new VariableInfo[] {};
  -    }
  -    else
  -    {
  -        return new VariableInfo []
  -        {
  -            new VariableInfo(varName,
  -                         "java.lang.String",
  -                         true,
  -                         VariableInfo.AT_END)
  -        };
  -    }
  -  }
  -
  -} // end of class
  +/*
  + * $Header$
  + * $Revision$
  + * $Date$
  + *
  + * ====================================================================
  + * 
  + * 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.i18n;
  +
  +import javax.servlet.jsp.tagext.*;
  +
  +public class FormatDateTEI extends TagExtraInfo
  +{
  +  public VariableInfo [] getVariableInfo (TagData data)
  +  {
  +    String varName = data.getId();
  +    if ( varName == null )
  +    {
  +        return new VariableInfo[] {};
  +    }
  +    else
  +    {
  +        return new VariableInfo []
  +        {
  +            new VariableInfo(varName,
  +                         "java.lang.String",
  +                         true,
  +                         VariableInfo.AT_END)
  +        };
  +    }
  +  }
  +
  +} // end of class
  
  
  
  1.3       +143 -143  jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/FormatDateTag.java
  
  Index: FormatDateTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/FormatDateTag.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FormatDateTag.java	14 Oct 2001 21:52:09 -0000	1.2
  +++ FormatDateTag.java	17 Dec 2002 04:18:59 -0000	1.3
  @@ -1,143 +1,143 @@
  -/*
  - * $Header$
  - * $Revision$
  - * $Date$
  - *
  - * ====================================================================
  - * 
  - * 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.i18n;
  -
  -import java.text.DateFormat;
  -import java.text.Format;
  -import java.text.SimpleDateFormat;
  -import java.util.Date;
  -
  -/** Formats a {@link java.util.Date} instance using a {@link java.util.Locale} and either a 
  -  * {@link java.text.DateFormat} or a pattern based {@link SimpleDateFormat}.
  -  *
  -  * @author James Strachan
  -  * @version $Revision$
  -  */
  -public class FormatDateTag extends FormatDateTagSupport {
  -    
  -    private Format format;
  -    private String pattern;
  -    private int style = DateFormat.SHORT;
  -    
  -
  -    public FormatDateTag() {
  -    }
  -    
  -
  -    // Tag interface
  -    //-------------------------------------------------------------------------
  -    public void release() {
  -        super.release();
  -        format = null;
  -        pattern = null;
  -    }
  -    
  -    // Properties
  -    //-------------------------------------------------------------------------
  -    
  -    /** If no {@link java.text.DateFormat} is configured then use a 
  -      * {@link SimpleDateFormat} instance if a pattern is configured else
  -      * use the default DateFormat for the {@link java.util.Locale}
  -      */
  -    public Format getFormat() {
  -        if ( format == null ) {
  -            String pattern = getPattern();
  -            if ( pattern != null ) {
  -                format = getPatternFormat( pattern );
  -            }
  -            if ( pattern == null ) {
  -                format = getDateFormat();
  -            }
  -        }
  -        return format;
  -    }
  -
  -    public void setFormat( DateFormat format ) {
  -        this.format = format;
  -    }
  -
  -    public String getPattern() {
  -        return pattern;
  -    }
  -    
  -    public void setPattern( String pattern ) {
  -        this.pattern = pattern;
  -    }
  -
  -    public void setStyle( String style ) {
  -        this.style = getStyleCode( style );
  -    }
  -    
  -    
  -    // Implementation methods
  -    //-------------------------------------------------------------------------
  -    protected DateFormat getPatternFormat( String pattern ) {
  -        // XXXX: Use a Locale based cache for these objects as per Craig's 
  -        // XXXX: suggestion        
  -        return new SimpleDateFormat( pattern, getLocale() );
  -    }
  -    
  -    protected DateFormat getDateFormat() {
  -        return DateFormat.getDateInstance( style, getLocale() );
  -    }
  -    
  -}
  +/*
  + * $Header$
  + * $Revision$
  + * $Date$
  + *
  + * ====================================================================
  + * 
  + * 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.i18n;
  +
  +import java.text.DateFormat;
  +import java.text.Format;
  +import java.text.SimpleDateFormat;
  +import java.util.Date;
  +
  +/** Formats a {@link java.util.Date} instance using a {@link java.util.Locale} and either a 
  +  * {@link java.text.DateFormat} or a pattern based {@link SimpleDateFormat}.
  +  *
  +  * @author James Strachan
  +  * @version $Revision$
  +  */
  +public class FormatDateTag extends FormatDateTagSupport {
  +    
  +    private Format format;
  +    private String pattern;
  +    private int style = DateFormat.SHORT;
  +    
  +
  +    public FormatDateTag() {
  +    }
  +    
  +
  +    // Tag interface
  +    //-------------------------------------------------------------------------
  +    public void release() {
  +        super.release();
  +        format = null;
  +        pattern = null;
  +    }
  +    
  +    // Properties
  +    //-------------------------------------------------------------------------
  +    
  +    /** If no {@link java.text.DateFormat} is configured then use a 
  +      * {@link SimpleDateFormat} instance if a pattern is configured else
  +      * use the default DateFormat for the {@link java.util.Locale}
  +      */
  +    public Format getFormat() {
  +        if ( format == null ) {
  +            String pattern = getPattern();
  +            if ( pattern != null ) {
  +                format = getPatternFormat( pattern );
  +            }
  +            if ( pattern == null ) {
  +                format = getDateFormat();
  +            }
  +        }
  +        return format;
  +    }
  +
  +    public void setFormat( DateFormat format ) {
  +        this.format = format;
  +    }
  +
  +    public String getPattern() {
  +        return pattern;
  +    }
  +    
  +    public void setPattern( String pattern ) {
  +        this.pattern = pattern;
  +    }
  +
  +    public void setStyle( String style ) {
  +        this.style = getStyleCode( style );
  +    }
  +    
  +    
  +    // Implementation methods
  +    //-------------------------------------------------------------------------
  +    protected DateFormat getPatternFormat( String pattern ) {
  +        // XXXX: Use a Locale based cache for these objects as per Craig's 
  +        // XXXX: suggestion        
  +        return new SimpleDateFormat( pattern, getLocale() );
  +    }
  +    
  +    protected DateFormat getDateFormat() {
  +        return DateFormat.getDateInstance( style, getLocale() );
  +    }
  +    
  +}
  
  
  
  1.2       +101 -101  jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/FormatDateTagSupport.java
  
  Index: FormatDateTagSupport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/FormatDateTagSupport.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FormatDateTagSupport.java	28 Apr 2001 15:05:44 -0000	1.1
  +++ FormatDateTagSupport.java	17 Dec 2002 04:18:59 -0000	1.2
  @@ -1,102 +1,102 @@
  -/*
  - * $Header$
  - * $Revision$
  - * $Date$
  - *
  - * ====================================================================
  - * 
  - * 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.i18n;
  -
  -import java.text.DateFormat;
  -import java.text.Format;
  -import java.util.Date;
  -
  -/** Abstract base class which supports the defaulting of the value to 'now' 
  -  * if no other value is specified. 
  -  *
  -  * @author James Strachan
  -  * @version $Revision$
  -  */
  -public abstract class FormatDateTagSupport extends FormatTagSupport  {
  -
  -    private boolean initialised;
  -    
  -    public FormatDateTagSupport() {
  -    }
  -    
  -    public void release() {
  -        super.release();
  -        initialised = false;
  -    }
  -    
  -    // Properties
  -    //-------------------------------------------------------------------------
  -    public Object getValue() {
  -        if ( ! initialised ) {
  -            // default to 'now' if no value has been specified
  -            super.setValue( new Date() );
  -            initialised = true;
  -        }
  -        return super.getValue();
  -    }
  -    
  -    public void setValue( Object value ) {
  -        super.setValue( value );
  -        initialised = true;
  -    }
  -}
  +/*
  + * $Header$
  + * $Revision$
  + * $Date$
  + *
  + * ====================================================================
  + * 
  + * 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.i18n;
  +
  +import java.text.DateFormat;
  +import java.text.Format;
  +import java.util.Date;
  +
  +/** Abstract base class which supports the defaulting of the value to 'now' 
  +  * if no other value is specified. 
  +  *
  +  * @author James Strachan
  +  * @version $Revision$
  +  */
  +public abstract class FormatDateTagSupport extends FormatTagSupport  {
  +
  +    private boolean initialised;
  +    
  +    public FormatDateTagSupport() {
  +    }
  +    
  +    public void release() {
  +        super.release();
  +        initialised = false;
  +    }
  +    
  +    // Properties
  +    //-------------------------------------------------------------------------
  +    public Object getValue() {
  +        if ( ! initialised ) {
  +            // default to 'now' if no value has been specified
  +            super.setValue( new Date() );
  +            initialised = true;
  +        }
  +        return super.getValue();
  +    }
  +    
  +    public void setValue( Object value ) {
  +        super.setValue( value );
  +        initialised = true;
  +    }
  +}
    
  
  
  
  1.2       +87 -87    jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/FormatDateTimeTEI.java
  
  Index: FormatDateTimeTEI.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/FormatDateTimeTEI.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FormatDateTimeTEI.java	16 Oct 2001 03:56:35 -0000	1.1
  +++ FormatDateTimeTEI.java	17 Dec 2002 04:18:59 -0000	1.2
  @@ -1,87 +1,87 @@
  -/*
  - * $Header$
  - * $Revision$
  - * $Date$
  - *
  - * ====================================================================
  - * 
  - * 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.i18n;
  -
  -import javax.servlet.jsp.tagext.*;
  -
  -public class FormatDateTimeTEI extends TagExtraInfo
  -{
  -  public VariableInfo [] getVariableInfo (TagData data)
  -  {
  -    String varName = data.getId();
  -    if ( varName == null )
  -    {
  -        return new VariableInfo[] {};
  -    }
  -    else
  -    {
  -        return new VariableInfo []
  -        {
  -            new VariableInfo(varName,
  -                         "java.lang.String",
  -                         true,
  -                         VariableInfo.AT_END)
  -        };
  -    }
  -  }
  -
  -} // end of class
  +/*
  + * $Header$
  + * $Revision$
  + * $Date$
  + *
  + * ====================================================================
  + * 
  + * 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.i18n;
  +
  +import javax.servlet.jsp.tagext.*;
  +
  +public class FormatDateTimeTEI extends TagExtraInfo
  +{
  +  public VariableInfo [] getVariableInfo (TagData data)
  +  {
  +    String varName = data.getId();
  +    if ( varName == null )
  +    {
  +        return new VariableInfo[] {};
  +    }
  +    else
  +    {
  +        return new VariableInfo []
  +        {
  +            new VariableInfo(varName,
  +                         "java.lang.String",
  +                         true,
  +                         VariableInfo.AT_END)
  +        };
  +    }
  +  }
  +
  +} // end of class
  
  
  
  1.3       +98 -98    jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/FormatDateTimeTag.java
  
  Index: FormatDateTimeTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/FormatDateTimeTag.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FormatDateTimeTag.java	14 Oct 2001 22:01:25 -0000	1.2
  +++ FormatDateTimeTag.java	17 Dec 2002 04:18:59 -0000	1.3
  @@ -1,98 +1,98 @@
  -/*
  - * $Header$
  - * $Revision$
  - * $Date$
  - *
  - * ====================================================================
  - * 
  - * 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.i18n;
  -
  -import java.text.DateFormat;
  -import java.text.Format;
  -
  -/** Formats a {@link java.util.Date} instance using the default Date and Time formatter 
  -  * for the current {@link java.util.Locale}.
  -  *
  -  * @author James Strachan
  -  * @version $Revision$
  -  */
  -public class FormatDateTimeTag extends FormatDateTagSupport   {
  -    
  -    private int dateStyle = DateFormat.SHORT;
  -    private int timeStyle = DateFormat.SHORT;
  -    
  -    
  -    public FormatDateTimeTag() {
  -    }
  -    
  -    // Properties
  -    //-------------------------------------------------------------------------
  -    public void setDateStyle( String style ) {
  -        this.dateStyle = getStyleCode( style );
  -    }
  -    
  -    public void setTimeStyle( String style ) {
  -        this.timeStyle = getStyleCode( style );
  -    }
  -    
  -    // Implementation methods
  -    //-------------------------------------------------------------------------
  -    protected Format getFormat() {
  -        return DateFormat.getDateTimeInstance( dateStyle, timeStyle, getLocale() );
  -    }      
  -}
  - 
  +/*
  + * $Header$
  + * $Revision$
  + * $Date$
  + *
  + * ====================================================================
  + * 
  + * 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.i18n;
  +
  +import java.text.DateFormat;
  +import java.text.Format;
  +
  +/** Formats a {@link java.util.Date} instance using the default Date and Time formatter 
  +  * for the current {@link java.util.Locale}.
  +  *
  +  * @author James Strachan
  +  * @version $Revision$
  +  */
  +public class FormatDateTimeTag extends FormatDateTagSupport   {
  +    
  +    private int dateStyle = DateFormat.SHORT;
  +    private int timeStyle = DateFormat.SHORT;
  +    
  +    
  +    public FormatDateTimeTag() {
  +    }
  +    
  +    // Properties
  +    //-------------------------------------------------------------------------
  +    public void setDateStyle( String style ) {
  +        this.dateStyle = getStyleCode( style );
  +    }
  +    
  +    public void setTimeStyle( String style ) {
  +        this.timeStyle = getStyleCode( style );
  +    }
  +    
  +    // Implementation methods
  +    //-------------------------------------------------------------------------
  +    protected Format getFormat() {
  +        return DateFormat.getDateTimeInstance( dateStyle, timeStyle, getLocale() );
  +    }      
  +}
  + 
  
  
  
  1.2       +87 -87    jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/FormatNumberTEI.java
  
  Index: FormatNumberTEI.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/FormatNumberTEI.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FormatNumberTEI.java	16 Oct 2001 03:56:35 -0000	1.1
  +++ FormatNumberTEI.java	17 Dec 2002 04:18:59 -0000	1.2
  @@ -1,87 +1,87 @@
  -/*
  - * $Header$
  - * $Revision$
  - * $Date$
  - *
  - * ====================================================================
  - * 
  - * 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.i18n;
  -
  -import javax.servlet.jsp.tagext.*;
  -
  -public class FormatNumberTEI extends TagExtraInfo
  -{
  -  public VariableInfo [] getVariableInfo (TagData data)
  -  {
  -    String varName = data.getId();
  -    if ( varName == null )
  -    {
  -        return new VariableInfo[] {};
  -    }
  -    else
  -    {
  -        return new VariableInfo []
  -        {
  -            new VariableInfo(varName,
  -                         "java.lang.String",
  -                         true,
  -                         VariableInfo.AT_END)
  -        };
  -    }
  -  }
  -
  -} // end of class
  +/*
  + * $Header$
  + * $Revision$
  + * $Date$
  + *
  + * ====================================================================
  + * 
  + * 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.i18n;
  +
  +import javax.servlet.jsp.tagext.*;
  +
  +public class FormatNumberTEI extends TagExtraInfo
  +{
  +  public VariableInfo [] getVariableInfo (TagData data)
  +  {
  +    String varName = data.getId();
  +    if ( varName == null )
  +    {
  +        return new VariableInfo[] {};
  +    }
  +    else
  +    {
  +        return new VariableInfo []
  +        {
  +            new VariableInfo(varName,
  +                         "java.lang.String",
  +                         true,
  +                         VariableInfo.AT_END)
  +        };
  +    }
  +  }
  +
  +} // end of class
  
  
  
  1.3       +144 -144  jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/FormatNumberTag.java
  
  Index: FormatNumberTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/FormatNumberTag.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FormatNumberTag.java	14 Oct 2001 22:01:25 -0000	1.2
  +++ FormatNumberTag.java	17 Dec 2002 04:18:59 -0000	1.3
  @@ -1,144 +1,144 @@
  -/*
  - * $Header$
  - * $Revision$
  - * $Date$
  - *
  - * ====================================================================
  - * 
  - * 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.i18n;
  -
  -import java.io.IOException;
  -import java.text.DecimalFormat;
  -import java.text.DecimalFormatSymbols;
  -import java.text.Format;
  -import java.text.NumberFormat;
  -import java.util.Enumeration;
  -import java.util.Locale;
  -
  -/** Formats a {@link Number} instance using a {@link java.util.Locale} and the 
  -  * {@link NumberFormat} or a {@link DecimalFormat} if a pattern is specified.
  -  *
  -  * @author James Strachan
  -  * @version $Revision$
  -  */
  -public class FormatNumberTag extends FormatTagSupport {
  -    
  -    private NumberFormat format;
  -    private String pattern;
  -    
  -    //-------------------------------------------------------------------------
  -    public FormatNumberTag() {
  -    }
  -    
  -
  -    // Tag interface
  -    //-------------------------------------------------------------------------
  -    public void release() {
  -        super.release();
  -        format = null;
  -        pattern = null;
  -    }
  -    
  -    // Properties
  -    //-------------------------------------------------------------------------
  -    
  -    /** If no {@link NumberFormat} is configured then use a 
  -      * {@link DecimalFormat} instance if a pattern is configured else
  -      * use the default NumberFormat for the {@link java.util.Locale}
  -      */
  -    public Format getFormat() {
  -        if ( format == null ) {
  -            String pattern = getPattern();
  -            if ( pattern != null ) {
  -                format = getPatternFormat( pattern );
  -            }
  -            if ( pattern == null ) {
  -                format = getNumberFormat();
  -            }
  -        }
  -        return format;
  -    }
  -
  -    public void setFormat( NumberFormat format ) {
  -        this.format = format;
  -    }
  -
  -    public String getPattern() {
  -        return pattern;
  -    }
  -    
  -    public void setPattern( String pattern ) {
  -        this.pattern = pattern;
  -    }
  -
  -    // Implementation methods
  -    //-------------------------------------------------------------------------
  -    protected NumberFormat getPatternFormat( String pattern ) {
  -        // XXXX: Use a Locale based cache for these objects as per Craig's 
  -        // XXXX: suggestion        
  -        return new DecimalFormat( pattern, new DecimalFormatSymbols( getLocale() ) );
  -    }
  -    
  -    /** @return the default number formatter for the current Locale 
  -      */
  -    protected NumberFormat getNumberFormat() {
  -        return NumberFormat.getInstance( getLocale() );
  -        // XXXX: what's the difference with the following:=
  -        // return NumberFormat.getNumberInstance( getLocale() );
  -    }
  -    
  -}
  +/*
  + * $Header$
  + * $Revision$
  + * $Date$
  + *
  + * ====================================================================
  + * 
  + * 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.i18n;
  +
  +import java.io.IOException;
  +import java.text.DecimalFormat;
  +import java.text.DecimalFormatSymbols;
  +import java.text.Format;
  +import java.text.NumberFormat;
  +import java.util.Enumeration;
  +import java.util.Locale;
  +
  +/** Formats a {@link Number} instance using a {@link java.util.Locale} and the 
  +  * {@link NumberFormat} or a {@link DecimalFormat} if a pattern is specified.
  +  *
  +  * @author James Strachan
  +  * @version $Revision$
  +  */
  +public class FormatNumberTag extends FormatTagSupport {
  +    
  +    private NumberFormat format;
  +    private String pattern;
  +    
  +    //-------------------------------------------------------------------------
  +    public FormatNumberTag() {
  +    }
  +    
  +
  +    // Tag interface
  +    //-------------------------------------------------------------------------
  +    public void release() {
  +        super.release();
  +        format = null;
  +        pattern = null;
  +    }
  +    
  +    // Properties
  +    //-------------------------------------------------------------------------
  +    
  +    /** If no {@link NumberFormat} is configured then use a 
  +      * {@link DecimalFormat} instance if a pattern is configured else
  +      * use the default NumberFormat for the {@link java.util.Locale}
  +      */
  +    public Format getFormat() {
  +        if ( format == null ) {
  +            String pattern = getPattern();
  +            if ( pattern != null ) {
  +                format = getPatternFormat( pattern );
  +            }
  +            if ( pattern == null ) {
  +                format = getNumberFormat();
  +            }
  +        }
  +        return format;
  +    }
  +
  +    public void setFormat( NumberFormat format ) {
  +        this.format = format;
  +    }
  +
  +    public String getPattern() {
  +        return pattern;
  +    }
  +    
  +    public void setPattern( String pattern ) {
  +        this.pattern = pattern;
  +    }
  +
  +    // Implementation methods
  +    //-------------------------------------------------------------------------
  +    protected NumberFormat getPatternFormat( String pattern ) {
  +        // XXXX: Use a Locale based cache for these objects as per Craig's 
  +        // XXXX: suggestion        
  +        return new DecimalFormat( pattern, new DecimalFormatSymbols( getLocale() ) );
  +    }
  +    
  +    /** @return the default number formatter for the current Locale 
  +      */
  +    protected NumberFormat getNumberFormat() {
  +        return NumberFormat.getInstance( getLocale() );
  +        // XXXX: what's the difference with the following:=
  +        // return NumberFormat.getNumberInstance( getLocale() );
  +    }
  +    
  +}
  
  
  
  1.2       +87 -87    jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/FormatPercentTEI.java
  
  Index: FormatPercentTEI.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/FormatPercentTEI.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FormatPercentTEI.java	16 Oct 2001 03:56:35 -0000	1.1
  +++ FormatPercentTEI.java	17 Dec 2002 04:18:59 -0000	1.2
  @@ -1,87 +1,87 @@
  -/*
  - * $Header$
  - * $Revision$
  - * $Date$
  - *
  - * ====================================================================
  - * 
  - * 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.i18n;
  -
  -import javax.servlet.jsp.tagext.*;
  -
  -public class FormatPercentTEI extends TagExtraInfo
  -{
  -  public VariableInfo [] getVariableInfo (TagData data)
  -  {
  -    String varName = data.getId();
  -    if ( varName == null )
  -    {
  -        return new VariableInfo[] {};
  -    }
  -    else
  -    {
  -        return new VariableInfo []
  -        {
  -            new VariableInfo(varName,
  -                         "java.lang.String",
  -                         true,
  -                         VariableInfo.AT_END)
  -        };
  -    }
  -  }
  -
  -} // end of class
  +/*
  + * $Header$
  + * $Revision$
  + * $Date$
  + *
  + * ====================================================================
  + * 
  + * 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.i18n;
  +
  +import javax.servlet.jsp.tagext.*;
  +
  +public class FormatPercentTEI extends TagExtraInfo
  +{
  +  public VariableInfo [] getVariableInfo (TagData data)
  +  {
  +    String varName = data.getId();
  +    if ( varName == null )
  +    {
  +        return new VariableInfo[] {};
  +    }
  +    else
  +    {
  +        return new VariableInfo []
  +        {
  +            new VariableInfo(varName,
  +                         "java.lang.String",
  +                         true,
  +                         VariableInfo.AT_END)
  +        };
  +    }
  +  }
  +
  +} // end of class
  
  
  
  1.3       +83 -83    jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/FormatPercentTag.java
  
  Index: FormatPercentTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/FormatPercentTag.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FormatPercentTag.java	14 Oct 2001 22:01:25 -0000	1.2
  +++ FormatPercentTag.java	17 Dec 2002 04:18:59 -0000	1.3
  @@ -1,83 +1,83 @@
  -/*
  - * $Header$
  - * $Revision$
  - * $Date$
  - *
  - * ====================================================================
  - * 
  - * 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.i18n;
  -
  -import java.text.Format;
  -import java.text.NumberFormat;
  -
  -/** Formats a {@link Number} instance using the current {@link java.util.Locale} 
  -  * and the Percent {@link NumberFormat}.
  -  *
  -  * @author James Strachan
  -  * @version $Revision$
  -  */
  -public class FormatPercentTag extends FormatTagSupport {
  -    
  -    public FormatPercentTag() {
  -    }
  -    
  -    // Implementation methods
  -    //-------------------------------------------------------------------------
  -    protected Format getFormat() {
  -        return NumberFormat.getPercentInstance( getLocale() );
  -    }
  -}
  +/*
  + * $Header$
  + * $Revision$
  + * $Date$
  + *
  + * ====================================================================
  + * 
  + * 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.i18n;
  +
  +import java.text.Format;
  +import java.text.NumberFormat;
  +
  +/** Formats a {@link Number} instance using the current {@link java.util.Locale} 
  +  * and the Percent {@link NumberFormat}.
  +  *
  +  * @author James Strachan
  +  * @version $Revision$
  +  */
  +public class FormatPercentTag extends FormatTagSupport {
  +    
  +    public FormatPercentTag() {
  +    }
  +    
  +    // Implementation methods
  +    //-------------------------------------------------------------------------
  +    protected Format getFormat() {
  +        return NumberFormat.getPercentInstance( getLocale() );
  +    }
  +}
  
  
  
  1.2       +87 -87    jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/FormatStringTEI.java
  
  Index: FormatStringTEI.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/FormatStringTEI.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FormatStringTEI.java	16 Oct 2001 03:56:35 -0000	1.1
  +++ FormatStringTEI.java	17 Dec 2002 04:18:59 -0000	1.2
  @@ -1,87 +1,87 @@
  -/*
  - * $Header$
  - * $Revision$
  - * $Date$
  - *
  - * ====================================================================
  - * 
  - * 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.i18n;
  -
  -import javax.servlet.jsp.tagext.*;
  -
  -public class FormatStringTEI extends TagExtraInfo
  -{
  -  public VariableInfo [] getVariableInfo (TagData data)
  -  {
  -    String varName = data.getId();
  -    if ( varName == null )
  -    {
  -        return new VariableInfo[] {};
  -    }
  -    else
  -    {
  -        return new VariableInfo []
  -        {
  -            new VariableInfo(varName,
  -                         "java.lang.String",
  -                         true,
  -                         VariableInfo.AT_END)
  -        };
  -    }
  -  }
  -
  -} // end of class
  +/*
  + * $Header$
  + * $Revision$
  + * $Date$
  + *
  + * ====================================================================
  + * 
  + * 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.i18n;
  +
  +import javax.servlet.jsp.tagext.*;
  +
  +public class FormatStringTEI extends TagExtraInfo
  +{
  +  public VariableInfo [] getVariableInfo (TagData data)
  +  {
  +    String varName = data.getId();
  +    if ( varName == null )
  +    {
  +        return new VariableInfo[] {};
  +    }
  +    else
  +    {
  +        return new VariableInfo []
  +        {
  +            new VariableInfo(varName,
  +                         "java.lang.String",
  +                         true,
  +                         VariableInfo.AT_END)
  +        };
  +    }
  +  }
  +
  +} // end of class
  
  
  
  1.2       +150 -150  jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/FormatStringTag.java
  
  Index: FormatStringTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/FormatStringTag.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FormatStringTag.java	29 Apr 2001 05:27:48 -0000	1.1
  +++ FormatStringTag.java	17 Dec 2002 04:18:59 -0000	1.2
  @@ -1,150 +1,150 @@
  -/*
  - * $Header$
  - * $Revision$
  - * $Date$
  - *
  - * ====================================================================
  - * 
  - * 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.i18n;
  -
  -import java.io.IOException;
  -import java.text.Format;
  -import java.text.DateFormat;
  -import java.util.Enumeration;
  -import java.util.Locale;
  -
  -import javax.servlet.ServletRequest;
  -import javax.servlet.jsp.JspException;
  -import javax.servlet.jsp.JspWriter;
  -import javax.servlet.jsp.PageContext;
  -import javax.servlet.jsp.tagext.Tag;
  -import javax.servlet.jsp.tagext.TagSupport;
  -
  -/** A simple tag that allows a String to be output with null handling.
  -  *
  -  * @author James Strachan
  -  * @version $Revision$
  -  */
  -public class FormatStringTag extends TagSupport {
  -    
  -    /** the value to be formatted */
  -    private String value;    
  -    /** the text output if the value is null */
  -    private String defaultText = "";
  -
  -
  -    public FormatStringTag() {
  -    }
  -    
  -
  -    // Tag interface
  -    //-------------------------------------------------------------------------
  -    public int doStartTag() throws JspException {
  -        return EVAL_BODY_INCLUDE;
  -    }
  -    
  -    public int doEndTag() throws JspException {
  -        try {
  -            JspWriter out = pageContext.getOut();
  -            String text = getValue();
  -            if ( text == null ) {
  -                text = getDefaultText();
  -                if ( text == null ) {
  -                    text = "";
  -                }
  -            }
  -            out.print( text );
  -        }
  -        catch ( IOException e ) {
  -            handleIOException( e );
  -        }
  -        return EVAL_PAGE;
  -    }
  -    
  -    public void release() {
  -        super.release();
  -        value = null;
  -        defaultText = "";
  -    }
  -    
  -    // Properties
  -    //-------------------------------------------------------------------------    
  -    public String getValue() {
  -        return value;
  -    }
  -    
  -    public void setValue( String value ) {
  -        this.value = value;
  -    }
  -
  -    public String getDefaultText() {
  -        return defaultText;
  -    }
  -    
  -    public void setDefaultText( String defaultText ) {
  -        this.defaultText = defaultText;
  -    }
  -    
  -    // Implementation methods
  -    //-------------------------------------------------------------------------    
  -    protected void handleIOException( IOException e ) throws JspException {
  -        pageContext.getServletContext().log( "Caught: IOException: " + e );
  -        throw new JspException( "IOException: " + e );
  -    }
  -}
  -
  -
  +/*
  + * $Header$
  + * $Revision$
  + * $Date$
  + *
  + * ====================================================================
  + * 
  + * 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.i18n;
  +
  +import java.io.IOException;
  +import java.text.Format;
  +import java.text.DateFormat;
  +import java.util.Enumeration;
  +import java.util.Locale;
  +
  +import javax.servlet.ServletRequest;
  +import javax.servlet.jsp.JspException;
  +import javax.servlet.jsp.JspWriter;
  +import javax.servlet.jsp.PageContext;
  +import javax.servlet.jsp.tagext.Tag;
  +import javax.servlet.jsp.tagext.TagSupport;
  +
  +/** A simple tag that allows a String to be output with null handling.
  +  *
  +  * @author James Strachan
  +  * @version $Revision$
  +  */
  +public class FormatStringTag extends TagSupport {
  +    
  +    /** the value to be formatted */
  +    private String value;    
  +    /** the text output if the value is null */
  +    private String defaultText = "";
  +
  +
  +    public FormatStringTag() {
  +    }
  +    
  +
  +    // Tag interface
  +    //-------------------------------------------------------------------------
  +    public int doStartTag() throws JspException {
  +        return EVAL_BODY_INCLUDE;
  +    }
  +    
  +    public int doEndTag() throws JspException {
  +        try {
  +            JspWriter out = pageContext.getOut();
  +            String text = getValue();
  +            if ( text == null ) {
  +                text = getDefaultText();
  +                if ( text == null ) {
  +                    text = "";
  +                }
  +            }
  +            out.print( text );
  +        }
  +        catch ( IOException e ) {
  +            handleIOException( e );
  +        }
  +        return EVAL_PAGE;
  +    }
  +    
  +    public void release() {
  +        super.release();
  +        value = null;
  +        defaultText = "";
  +    }
  +    
  +    // Properties
  +    //-------------------------------------------------------------------------    
  +    public String getValue() {
  +        return value;
  +    }
  +    
  +    public void setValue( String value ) {
  +        this.value = value;
  +    }
  +
  +    public String getDefaultText() {
  +        return defaultText;
  +    }
  +    
  +    public void setDefaultText( String defaultText ) {
  +        this.defaultText = defaultText;
  +    }
  +    
  +    // Implementation methods
  +    //-------------------------------------------------------------------------    
  +    protected void handleIOException( IOException e ) throws JspException {
  +        pageContext.getServletContext().log( "Caught: IOException: " + e );
  +        throw new JspException( "IOException: " + e );
  +    }
  +}
  +
  +
  
  
  
  1.5       +220 -220  jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/FormatTagSupport.java
  
  Index: FormatTagSupport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/FormatTagSupport.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- FormatTagSupport.java	14 Oct 2001 22:01:25 -0000	1.4
  +++ FormatTagSupport.java	17 Dec 2002 04:18:59 -0000	1.5
  @@ -1,220 +1,220 @@
  -/*
  - * $Header$
  - * $Revision$
  - * $Date$
  - *
  - * ====================================================================
  - * 
  - * 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.i18n;
  -
  -import java.io.IOException;
  -import java.text.Format;
  -import java.text.DateFormat;
  -import java.util.Enumeration;
  -import java.util.Locale;
  -
  -import javax.servlet.ServletRequest;
  -import javax.servlet.jsp.JspException;
  -import javax.servlet.jsp.JspWriter;
  -import javax.servlet.jsp.PageContext;
  -import javax.servlet.jsp.tagext.Tag;
  -import javax.servlet.jsp.tagext.TagSupport;
  -
  -/** An abstract base class for the formatting tags to provide 
  -  * implementation inheritence.
  -  *
  -  * @author James Strachan
  -  * @version $Revision$
  -  */
  -public abstract class FormatTagSupport extends TagSupport {
  -    
  -    /** the value to be formatted */
  -    private Object value;    
  -    /** the locale used to format the value */
  -    private Locale locale;
  -    /** the text output if the value is null */
  -    private String defaultText = "";
  -
  -
  -    public FormatTagSupport() {
  -    }
  -    
  -
  -    // Tag interface
  -    //-------------------------------------------------------------------------
  -    public int doStartTag() throws JspException {
  -        return EVAL_BODY_INCLUDE;
  -    }
  -    
  -    public int doEndTag() throws JspException {
  -        try {
  -            Object value = getValue();
  -            JspWriter out = pageContext.getOut();
  -            String text = null;
  -            if ( value != null ) {
  -                Format formatter = getFormat();
  -                if ( formatter == null ) {
  -                    throw new JspException( "Could not find valid Format instance" );
  -                }
  -                text = formatter.format( value );
  -            }
  -            else {
  -                text = getDefaultText();
  -            }
  -            if ( text != null ) {
  -                out.print( text );
  -            }
  -        }
  -        catch ( IOException e ) {
  -            handleIOException( e );
  -        }
  -        return EVAL_PAGE;
  -    }
  -    
  -    public void release() {
  -        super.release();
  -        value = null;
  -        locale = null;
  -        defaultText = "";
  -    }
  -    
  -    // Properties
  -    //-------------------------------------------------------------------------    
  -    public Object getValue() {
  -        return value;
  -    }
  -    
  -    public void setValue( Object value ) {
  -        this.value = value;
  -    }
  -
  -    /** If no {@link java.util.Locale} has been explicitly configured then use the
  -      * parent LocaleTag if present else the Locale from the ServletRequest
  -      * else use the default JVM {@link java.util.Locale}.
  -      */
  -    public Locale getLocale() {
  -        if ( locale == null ) {
  -            return findLocale();
  -        }
  -        return locale;
  -    }
  -    
  -    public void setLocale( Locale locale ) {
  -        this.locale = locale;
  -    }
  -
  -    public String getDefaultText() {
  -        return defaultText;
  -    }
  -    
  -    public void setDefaultText( String defaultText ) {
  -        this.defaultText = defaultText;
  -    }
  -
  -    
  -    // Implementation methods
  -    //-------------------------------------------------------------------------
  -    
  -    /** Abstract class to return the value formatter 
  -      */
  -    protected abstract Format getFormat();    
  -    
  -    protected void handleIOException( IOException e ) throws JspException {
  -        pageContext.getServletContext().log( "Caught: IOException: " + e );
  -        throw new JspException( "IOException: " + e );
  -    }
  -
  -    /** finds the current locale from either an outer LocaleTag or the 
  -      * current SerlvetRequest or the current JVM.
  -      *
  -      * @return a Locale instance
  -      */
  -    protected Locale findLocale() {
  -        // lets try find a LocaleTag first
  -        LocaleTag localeTag = (LocaleTag) findAncestorWithClass( this, LocaleTag.class );
  -        if ( localeTag != null ) {
  -            return localeTag.getLocale();
  -        }
  -        else {
  -            return pageContext.getResponse().getLocale();
  -        }
  -    }
  -    
  -    
  -    /** A helper method for date, datetime & time based formatting tags.
  -      * This method converts a string into a DateFormat style code.
  -      */
  -    protected int getStyleCode( String style ) {
  -        if ( "short".equalsIgnoreCase( style ) ) {
  -            return DateFormat.SHORT; 
  -        }
  -        else if ( "medium".equalsIgnoreCase( style ) ) {
  -            return DateFormat.MEDIUM; 
  -        }
  -        else if ( "long".equalsIgnoreCase( style ) ) {
  -            return DateFormat.LONG; 
  -        }
  -        else if ( "full".equalsIgnoreCase( style ) ) {
  -            return DateFormat.FULL; 
  -        }
  -        else {
  -            return DateFormat.SHORT;
  -        }
  -    }
  -}
  -
  -
  +/*
  + * $Header$
  + * $Revision$
  + * $Date$
  + *
  + * ====================================================================
  + * 
  + * 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.i18n;
  +
  +import java.io.IOException;
  +import java.text.Format;
  +import java.text.DateFormat;
  +import java.util.Enumeration;
  +import java.util.Locale;
  +
  +import javax.servlet.ServletRequest;
  +import javax.servlet.jsp.JspException;
  +import javax.servlet.jsp.JspWriter;
  +import javax.servlet.jsp.PageContext;
  +import javax.servlet.jsp.tagext.Tag;
  +import javax.servlet.jsp.tagext.TagSupport;
  +
  +/** An abstract base class for the formatting tags to provide 
  +  * implementation inheritence.
  +  *
  +  * @author James Strachan
  +  * @version $Revision$
  +  */
  +public abstract class FormatTagSupport extends TagSupport {
  +    
  +    /** the value to be formatted */
  +    private Object value;    
  +    /** the locale used to format the value */
  +    private Locale locale;
  +    /** the text output if the value is null */
  +    private String defaultText = "";
  +
  +
  +    public FormatTagSupport() {
  +    }
  +    
  +
  +    // Tag interface
  +    //-------------------------------------------------------------------------
  +    public int doStartTag() throws JspException {
  +        return EVAL_BODY_INCLUDE;
  +    }
  +    
  +    public int doEndTag() throws JspException {
  +        try {
  +            Object value = getValue();
  +            JspWriter out = pageContext.getOut();
  +            String text = null;
  +            if ( value != null ) {
  +                Format formatter = getFormat();
  +                if ( formatter == null ) {
  +                    throw new JspException( "Could not find valid Format instance" );
  +                }
  +                text = formatter.format( value );
  +            }
  +            else {
  +                text = getDefaultText();
  +            }
  +            if ( text != null ) {
  +                out.print( text );
  +            }
  +        }
  +        catch ( IOException e ) {
  +            handleIOException( e );
  +        }
  +        return EVAL_PAGE;
  +    }
  +    
  +    public void release() {
  +        super.release();
  +        value = null;
  +        locale = null;
  +        defaultText = "";
  +    }
  +    
  +    // Properties
  +    //-------------------------------------------------------------------------    
  +    public Object getValue() {
  +        return value;
  +    }
  +    
  +    public void setValue( Object value ) {
  +        this.value = value;
  +    }
  +
  +    /** If no {@link java.util.Locale} has been explicitly configured then use the
  +      * parent LocaleTag if present else the Locale from the ServletRequest
  +      * else use the default JVM {@link java.util.Locale}.
  +      */
  +    public Locale getLocale() {
  +        if ( locale == null ) {
  +            return findLocale();
  +        }
  +        return locale;
  +    }
  +    
  +    public void setLocale( Locale locale ) {
  +        this.locale = locale;
  +    }
  +
  +    public String getDefaultText() {
  +        return defaultText;
  +    }
  +    
  +    public void setDefaultText( String defaultText ) {
  +        this.defaultText = defaultText;
  +    }
  +
  +    
  +    // Implementation methods
  +    //-------------------------------------------------------------------------
  +    
  +    /** Abstract class to return the value formatter 
  +      */
  +    protected abstract Format getFormat();    
  +    
  +    protected void handleIOException( IOException e ) throws JspException {
  +        pageContext.getServletContext().log( "Caught: IOException: " + e );
  +        throw new JspException( "IOException: " + e );
  +    }
  +
  +    /** finds the current locale from either an outer LocaleTag or the 
  +      * current SerlvetRequest or the current JVM.
  +      *
  +      * @return a Locale instance
  +      */
  +    protected Locale findLocale() {
  +        // lets try find a LocaleTag first
  +        LocaleTag localeTag = (LocaleTag) findAncestorWithClass( this, LocaleTag.class );
  +        if ( localeTag != null ) {
  +            return localeTag.getLocale();
  +        }
  +        else {
  +            return pageContext.getResponse().getLocale();
  +        }
  +    }
  +    
  +    
  +    /** A helper method for date, datetime & time based formatting tags.
  +      * This method converts a string into a DateFormat style code.
  +      */
  +    protected int getStyleCode( String style ) {
  +        if ( "short".equalsIgnoreCase( style ) ) {
  +            return DateFormat.SHORT; 
  +        }
  +        else if ( "medium".equalsIgnoreCase( style ) ) {
  +            return DateFormat.MEDIUM; 
  +        }
  +        else if ( "long".equalsIgnoreCase( style ) ) {
  +            return DateFormat.LONG; 
  +        }
  +        else if ( "full".equalsIgnoreCase( style ) ) {
  +            return DateFormat.FULL; 
  +        }
  +        else {
  +            return DateFormat.SHORT;
  +        }
  +    }
  +}
  +
  +
  
  
  
  1.2       +87 -87    jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/FormatTimeTEI.java
  
  Index: FormatTimeTEI.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/FormatTimeTEI.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FormatTimeTEI.java	16 Oct 2001 03:56:35 -0000	1.1
  +++ FormatTimeTEI.java	17 Dec 2002 04:18:59 -0000	1.2
  @@ -1,87 +1,87 @@
  -/*
  - * $Header$
  - * $Revision$
  - * $Date$
  - *
  - * ====================================================================
  - * 
  - * 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.i18n;
  -
  -import javax.servlet.jsp.tagext.*;
  -
  -public class FormatTimeTEI extends TagExtraInfo
  -{
  -  public VariableInfo [] getVariableInfo (TagData data)
  -  {
  -    String varName = data.getId();
  -    if ( varName == null )
  -    {
  -        return new VariableInfo[] {};
  -    }
  -    else
  -    {
  -        return new VariableInfo []
  -        {
  -            new VariableInfo(varName,
  -                         "java.lang.String",
  -                         true,
  -                         VariableInfo.AT_END)
  -        };
  -    }
  -  }
  -
  -} // end of class
  +/*
  + * $Header$
  + * $Revision$
  + * $Date$
  + *
  + * ====================================================================
  + * 
  + * 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.i18n;
  +
  +import javax.servlet.jsp.tagext.*;
  +
  +public class FormatTimeTEI extends TagExtraInfo
  +{
  +  public VariableInfo [] getVariableInfo (TagData data)
  +  {
  +    String varName = data.getId();
  +    if ( varName == null )
  +    {
  +        return new VariableInfo[] {};
  +    }
  +    else
  +    {
  +        return new VariableInfo []
  +        {
  +            new VariableInfo(varName,
  +                         "java.lang.String",
  +                         true,
  +                         VariableInfo.AT_END)
  +        };
  +    }
  +  }
  +
  +} // end of class
  
  
  
  1.3       +93 -93    jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/FormatTimeTag.java
  
  Index: FormatTimeTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/FormatTimeTag.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FormatTimeTag.java	14 Oct 2001 22:01:25 -0000	1.2
  +++ FormatTimeTag.java	17 Dec 2002 04:18:59 -0000	1.3
  @@ -1,93 +1,93 @@
  -/*
  - * $Header$
  - * $Revision$
  - * $Date$
  - *
  - * ====================================================================
  - * 
  - * 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.i18n;
  -
  -import java.text.DateFormat;
  -import java.text.Format;
  -
  -/** Formats a {@link java.util.Date} instance using a {@link java.util.Locale} and the 
  -  * default time format.
  -  *
  -  * @author James Strachan
  -  * @version $Revision$
  -  */
  -public class FormatTimeTag extends FormatDateTagSupport  {
  -
  -    private int style = DateFormat.SHORT;
  -    
  -    
  -    public FormatTimeTag() {
  -    }
  -    
  -    // Properties
  -    //-------------------------------------------------------------------------
  -    public void setStyle( String style ) {
  -        this.style = getStyleCode( style );
  -    }
  -    
  -    // Implementation methods
  -    //-------------------------------------------------------------------------
  -    protected Format getFormat() {
  -        return DateFormat.getTimeInstance( style, getLocale() );
  -    }  
  -}
  - 
  +/*
  + * $Header$
  + * $Revision$
  + * $Date$
  + *
  + * ====================================================================
  + * 
  + * 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.i18n;
  +
  +import java.text.DateFormat;
  +import java.text.Format;
  +
  +/** Formats a {@link java.util.Date} instance using a {@link java.util.Locale} and the 
  +  * default time format.
  +  *
  +  * @author James Strachan
  +  * @version $Revision$
  +  */
  +public class FormatTimeTag extends FormatDateTagSupport  {
  +
  +    private int style = DateFormat.SHORT;
  +    
  +    
  +    public FormatTimeTag() {
  +    }
  +    
  +    // Properties
  +    //-------------------------------------------------------------------------
  +    public void setStyle( String style ) {
  +        this.style = getStyleCode( style );
  +    }
  +    
  +    // Implementation methods
  +    //-------------------------------------------------------------------------
  +    protected Format getFormat() {
  +        return DateFormat.getTimeInstance( style, getLocale() );
  +    }  
  +}
  + 
  
  
  
  1.2       +83 -87    jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/LocaleTEI.java
  
  Index: LocaleTEI.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/LocaleTEI.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LocaleTEI.java	16 Oct 2001 03:56:35 -0000	1.1
  +++ LocaleTEI.java	17 Dec 2002 04:18:59 -0000	1.2
  @@ -1,87 +1,83 @@
  -/*
  - * $Header$
  - * $Revision$
  - * $Date$
  - *
  - * ====================================================================
  - * 
  - * 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.i18n;
  -
  -import javax.servlet.jsp.tagext.*;
  -
  -public class LocaleTEI extends TagExtraInfo
  -{
  -  public VariableInfo [] getVariableInfo (TagData data)
  -  {
  -    String varName = data.getId();
  -    if ( varName == null )
  -    {
  -        return new VariableInfo[] {};
  -    }
  -    else
  -    {
  -        return new VariableInfo []
  -        {
  -            new VariableInfo(varName,
  -                         "java.lang.String",
  -                         true,
  -                         VariableInfo.AT_END)
  -        };
  -    }
  -  }
  -
  -} // end of class
  +/*
  + * $Header$
  + * $Revision$
  + * $Date$
  + *
  + * ====================================================================
  + * 
  + * 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.i18n;
  +
  +import javax.servlet.jsp.tagext.*;
  +
  +public class LocaleTEI extends TagExtraInfo
  +{
  +    public VariableInfo [] getVariableInfo (TagData data)
  +    {
  +        String varName = data.getId();
  +        if ( varName == null ) {
  +            return new VariableInfo[] {};
  +        } else {
  +            return new VariableInfo [] {
  +                new VariableInfo(varName,
  +                                 "java.util.Locale",
  +                                 true,
  +                                 VariableInfo.AT_END)
  +            };
  +        }
  +    }
  +
  +}
  
  
  
  1.5       +206 -236  jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/LocaleTag.java
  
  Index: LocaleTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/LocaleTag.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- LocaleTag.java	18 Oct 2001 13:28:18 -0000	1.4
  +++ LocaleTag.java	17 Dec 2002 04:18:59 -0000	1.5
  @@ -1,236 +1,206 @@
  -/*
  - * $Header$
  - * $Revision$
  - * $Date$
  - *
  - * ====================================================================
  - *
  - * 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.i18n;
  -
  -import java.util.Enumeration;
  -import java.util.Locale;
  -
  -import javax.servlet.ServletRequest;
  -import javax.servlet.jsp.JspException;
  -import javax.servlet.jsp.PageContext;
  -import javax.servlet.jsp.tagext.TagSupport;
  -
  -
  -/** This tag defines a
  -    {@link java.util.Locale}
  -    context for use by other inner JSP tags.
  -  * If no has been configured directly via the "locale" property then the
  -  * language, country and optional varient properties are used to
  -  * create a new Locale instance.
  -  * If these properties are not specified then the Locale is taken from
  -  * {@link javax.servlet.ServletRequest}
  -  is used.
  -  * If still no
  -  {@link java.util.Locale}
  -  could be found then the default JVM
  -  * {@link java.util.Locale}
  -  is used.
  -  *
  -  * @author James Strachan
  -  * @version $Revision$
  -  */
  -public class LocaleTag extends TagSupport
  -  {
  -  /** Holds value of property locale. */
  -  private Locale locale;
  -  /** Holds value of property language. */
  -  private String language;
  -  /** Holds value of property country. */
  -  private String country;
  -  /** Holds value of property variant. */
  -  private String variant;
  -  /** specifies whether or not the response locale should be changed to match
  -   *  the locale used by this tag */
  -  private boolean changeResponseLocale = true;
  -
  -
  -  //-------------------------------------------------------------------------
  -  public LocaleTag()
  -    {
  -    }
  -
  -
  -  // Tag interface
  -  //-------------------------------------------------------------------------
  -  public int doStartTag() throws JspException
  -    {
  -    // set the bundle as a variable in the page
  -    if ( this.getId() != null )
  -        {
  -        pageContext.setAttribute(this.getId(),this.getLocale());
  -        }
  -    
  -    return EVAL_BODY_INCLUDE;
  -    }
  -
  -  /**
  -   *  Sets the response locale if the changeResponseLocale attribute was set
  -   *  to true, OR if changeResponseLocale was unset and the tag was empty
  -   */
  -  public int doEndTag()
  -          throws JspException
  -    {
  -    if (this.changeResponseLocale)
  -        {
  -        // set the locale for the response
  -        pageContext.getResponse().setLocale(this.getLocale());
  -        }
  -        
  -    return EVAL_PAGE;
  -    }
  -
  -  public void setChangeResponseLocale(boolean value)
  -    {
  -    this.changeResponseLocale = value;
  -    }
  -
  -  public void release()
  -    {
  -    super.release();
  -    locale = null;
  -    language = null;
  -    country = null;
  -    variant = null;
  -    changeResponseLocale = true;
  -    }
  -
  -  // Properties
  -  //-------------------------------------------------------------------------
  -  public Locale getLocale()
  -    {
  -    if (locale == null)
  -        {
  -        locale = createLocale();
  -        }
  -    return locale;
  -    }
  -
  -  public void setLocale(Locale locale)
  -    {
  -    this.locale = locale;
  -    }
  -
  -  /**
  -   *  Provides a key to retrieve a locale via findAttribute()
  -   */
  -  public void setLocaleRef(String value)
  -    {
  -    this.locale = (Locale)pageContext.findAttribute(value);
  -    }
  -
  -  public String getLanguage()
  -    {
  -    return language;
  -    }
  -
  -  public void setLanguage(String language)
  -    {
  -    this.language = language;
  -    }
  -
  -  public String getCountry()
  -    {
  -    return country;
  -    }
  -
  -  public void setCountry(String country)
  -    {
  -    this.country = country;
  -    }
  -
  -  public String getVariant()
  -    {
  -    return variant;
  -    }
  -
  -  public void setVariant(String variant)
  -    {
  -    this.variant = variant;
  -    }
  -
  -  // Implementation methods
  -  //-------------------------------------------------------------------------
  -  protected Locale createLocale()
  -    {
  -    // let's try use the language & country properties first...
  -    Locale locale = null;
  -    if (language == null)
  -        {
  -        locale = pageContext.getResponse().getLocale();
  -        }
  -    else if (country == null)
  -        {
  -        locale = new Locale(language,"");
  -        }
  -    else if (variant == null)
  -        {
  -        locale = new Locale(language, country);
  -        }
  -    else
  -        {
  -        locale = new Locale(language, country, variant);
  -        }
  -
  -    return locale;
  -    }
  -
  -  }
  +/*
  + * $Header$
  + * $Revision$
  + * $Date$
  + *
  + * ====================================================================
  + *
  + * 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.i18n;
  +
  +import java.util.Enumeration;
  +import java.util.Locale;
  +
  +import javax.servlet.ServletRequest;
  +import javax.servlet.jsp.JspException;
  +import javax.servlet.jsp.PageContext;
  +import javax.servlet.jsp.tagext.TagSupport;
  +
  +
  +/** This tag defines a {@link java.util.Locale} context for use by other
  +  * inner JSP tags.
  +  *
  +  * If no locale has been configured directly via the "locale" property
  +  * then the language, country and optional varient properties are used
  +  * to create a new Locale instance.
  +  * If these properties are not specified then the Locale is taken from
  +  * {@link javax.servlet.ServletRequest} is used.
  +  * If still no {@link java.util.Locale} could be found then the default JVM
  +  * {@link java.util.Locale} is used.
  +  *
  +  * @author James Strachan
  +  * @version $Revision$
  +  */
  +public class LocaleTag extends TagSupport
  +{
  +    /** Holds value of property locale. */
  +    private Locale locale;
  +    /** Holds value of property localeRef. */
  +    private String localeRef;
  +    /** Holds value of property language. */
  +    private String language;
  +    /** Holds value of property country. */
  +    private String country;
  +    /** Holds value of property variant. */
  +    private String variant;
  +    /** specifies whether or not the response locale should be changed to match
  +     *  the locale used by this tag */
  +    private boolean changeResponseLocale = true;
  +
  +
  +    // Tag interface
  +    //-------------------------------------------------------------------------
  +    public int doStartTag() throws JspException
  +    {
  +        // set the locale as a variable in the page
  +        if ( this.getId() != null ) {
  +            pageContext.setAttribute(getId(),getLocale());
  +        }
  +    
  +    return EVAL_BODY_INCLUDE;
  +    }
  +
  +    /**
  +     *  Sets the response locale if the changeResponseLocale attribute was set
  +     *  to true, OR if changeResponseLocale was unset and the tag was empty
  +     */
  +    public int doEndTag() throws JspException
  +    {
  +        if (this.changeResponseLocale) {
  +            // set the locale for the response
  +            pageContext.getResponse().setLocale(getLocale());
  +        }
  +        
  +    return EVAL_PAGE;
  +    }
  +
  +    public void setChangeResponseLocale(boolean value)
  +    {
  +        changeResponseLocale = value;
  +    }
  +
  +    public void release()
  +    {
  +        super.release();
  +        locale = null;
  +        language = null;
  +        country = null;
  +        variant = null;
  +        changeResponseLocale = true;
  +    }
  +
  +    // Properties
  +    //-------------------------------------------------------------------------
  +    protected final Locale getLocale()
  +    {
  +        if (localeRef != null) {
  +            locale = (Locale)pageContext.findAttribute(localeRef);
  +        }
  +        if (locale == null) {
  +            locale = createLocale();
  +        }
  +        return locale;
  +    }
  +
  +    public final void setLocale(Locale locale)
  +    {
  +        this.locale = locale;
  +    }
  +
  +    /**
  +     *  Provides a key to retrieve a locale via findAttribute()
  +     */
  +    public final void setLocaleRef(String value)
  +    {
  +        this.localeRef = value;
  +    }
  +
  +    public final void setLanguage(String language)
  +    {
  +        this.language = language;
  +    }
  +
  +    public final void setCountry(String country)
  +    {
  +        this.country = country;
  +    }
  +
  +    public final void setVariant(String variant)
  +    {
  +        this.variant = variant;
  +    }
  +
  +    // Implementation methods
  +    //-------------------------------------------------------------------------
  +    private Locale createLocale()
  +    {
  +        // let's try use the language & country properties first...
  +        Locale locale = null;
  +        if (language == null) {
  +            locale = pageContext.getResponse().getLocale();
  +        } else if (country == null)
  +            {
  +            locale = new Locale(language,"");
  +        } else if (variant == null) {
  +            locale = new Locale(language, country);
  +        } else {
  +            locale = new Locale(language, country, variant);
  +        }
  +
  +        return locale;
  +    }
  +
  +}
  
  
  
  1.2       +87 -87    jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/MessageTEI.java
  
  Index: MessageTEI.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/MessageTEI.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MessageTEI.java	16 Oct 2001 03:56:35 -0000	1.1
  +++ MessageTEI.java	17 Dec 2002 04:18:59 -0000	1.2
  @@ -1,87 +1,87 @@
  -/*
  - * $Header$
  - * $Revision$
  - * $Date$
  - *
  - * ====================================================================
  - * 
  - * 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.i18n;
  -
  -import javax.servlet.jsp.tagext.*;
  -
  -public class MessageTEI extends TagExtraInfo
  -{
  -  public VariableInfo [] getVariableInfo (TagData data)
  -  {
  -    String varName = data.getId();
  -    if ( varName == null )
  -    {
  -        return new VariableInfo[] {};
  -    }
  -    else
  -    {
  -        return new VariableInfo []
  -        {
  -            new VariableInfo(varName,
  -                         "java.lang.String",
  -                         true,
  -                         VariableInfo.AT_END)
  -        };
  -    }
  -  }
  -
  -} // end of class
  +/*
  + * $Header$
  + * $Revision$
  + * $Date$
  + *
  + * ====================================================================
  + * 
  + * 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.i18n;
  +
  +import javax.servlet.jsp.tagext.*;
  +
  +public class MessageTEI extends TagExtraInfo
  +{
  +  public VariableInfo [] getVariableInfo (TagData data)
  +  {
  +    String varName = data.getId();
  +    if ( varName == null )
  +    {
  +        return new VariableInfo[] {};
  +    }
  +    else
  +    {
  +        return new VariableInfo []
  +        {
  +            new VariableInfo(varName,
  +                         "java.lang.String",
  +                         true,
  +                         VariableInfo.AT_END)
  +        };
  +    }
  +  }
  +
  +} // end of class
  
  
  
  1.5       +160 -182  jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/MessageTag.java
  
  Index: MessageTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/MessageTag.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- MessageTag.java	16 Oct 2001 04:02:08 -0000	1.4
  +++ MessageTag.java	17 Dec 2002 04:18:59 -0000	1.5
  @@ -74,11 +74,11 @@
   import javax.servlet.ServletContext;
   
   import javax.servlet.jsp.JspException;
  +import javax.servlet.jsp.JspTagException;
   import javax.servlet.jsp.PageContext;
   import javax.servlet.jsp.tagext.BodyTag;
   import javax.servlet.jsp.tagext.BodyTagSupport;
   
  -
   /**
    *  This class implements a body tag that allows you to use a resource bundle
    *  to internationalize content in a web page. The "key" attribute is required,
  @@ -90,7 +90,7 @@
    *  <P>
    *  <H2>Examples</H2>
    *  <PRE>
  - *  &lt;i18n:localize bundle="test"/&gt;
  + *  &lt;i18n:bundle baseName="test"/&gt;
    *  &lt;i18n:getMessage key="test"/&gt;
    *  &lt;i18n:getMessage key="test" args="1,2,3"/&gt;
    *  etc...
  @@ -101,215 +101,193 @@
    *
    */
   public class MessageTag extends BodyTagSupport
  -  {
  -  // instance variables used during processing
  -  private String               _key = null;
  -  private String               _value = null;
  -  private ResourceBundle       _bundle = null;
  -  private boolean              _debug = false;
  -  
  -  // these are reused for each message tag; luckily tags are thread-safe
  -  private final MessageFormat  _messageFormat = new MessageFormat("");
  -  private final List           _arguments = new ArrayList();
  -
  -  /**
  -   *  sets the key to use when looking up the value in the bundle
  -   */
  -  public void setKey(String key)
  -    {
  -    _key = key;
  -    }
  -
  -  /**
  -   *  @return the key to use
  -   */
  -  public String getKey()
  -    {
  -    return _key;
  -    }
  -
  -  /**
  -   *  sets the bundle based on a variable defined in the page<br>
  -   *  if neither bundle or bundleRef are specified, uses the first bundle
  -   *  defined on the page by the i18n:bundle tag
  -   */
  -  public void setBundleRef(String varName)
  -    {
  -    _bundle = (ResourceBundle)pageContext.getAttribute(varName);
  +{
  +    // instance variables used during processing
  +    private String               _key = null;
  +    private String               _value = null;
  +    private ResourceBundle       _bundle = null;
  +    private String               _bundleRef = null;
  +    private Object []		 _args = null;
  +    private boolean              _debug = false;
  +
  +    // these are reused for each message tag; luckily tags are thread-safe
  +    private MessageFormat  _messageFormat = new MessageFormat("");
  +    private List           _arguments = new ArrayList();
  +
  +    /**
  +     *  sets the key to use when looking up the value in the bundle
  +     */
  +    public final void setKey(String key)
  +    {
  +        _key = key;
  +    }
  +
  +    /**
  +     *  sets the bundle based on a variable defined in the page<br>
  +     *  if neither bundle or bundleRef are specified, uses the first bundle
  +     *  defined on the page by the i18n:bundle tag
  +     */
  +    public final void setBundleRef(String varName)
  +    {
  +        _bundleRef = varName;
  +    }
  +
  +    /**
  +     *  sets the bundle to an actual ResourceBundle object<br>
  +     *  if neither bundle or bundleRef are specified, uses the bundle most recently
  +     *  defined on the page by the i18n:bundle tag
  +     */
  +    public final void setBundle(ResourceBundle aBundle)
  +    {
  +        _bundle = aBundle;
  +    }
  +
  +    /**
  +     *  @return the bundle to use
  +     */
  +    private ResourceBundle getBundle() throws JspException
  +    {
  +        ResourceBundle bundle = _bundle;
  +        if ( bundle == null ) {
  +            if ( _bundleRef != null ) {
  +                bundle = (ResourceBundle)pageContext.getAttribute(_bundleRef);
  +                if ( bundle == null ) {
  +                    throw new JspTagException(
  +                        "i18n:message tag, could not find bundleRef=" + _bundleRef);
  +                }
  +            } else {
  +                BundleTag bundleTag = (BundleTag)this.findAncestorWithClass(this,BundleTag.class);
  +                if (bundleTag != null) {
  +                    return bundleTag.getBundle();
  +                }
  +                bundle = ResourceHelper.getBundle(pageContext);
  +            }
  +        }
  +        return bundle;
       }
   
  -  /**
  -   *  sets the bundle to an actual ResourceBundle object<br>
  -   *  if neither bundle or bundleRef are specified, uses the bundle most recently
  -   *  defined on the page by the i18n:bundle tag
  -   */
  -  public void setBundle(ResourceBundle aBundle)
  +    /**
  +     * Turn debugging log messages on or off
  +     */
  +    public final void setDebug(boolean value)
       {
  -    _bundle = aBundle;
  +        _debug = value;
       }
   
  -  /**
  -   *  @return the bundle to use
  -   */
  -  public ResourceBundle getBundle()
  +    /**
  +     *  adds to the list of arguments used when formatting the message
  +     */
  +    protected final void addArg(Object arg)
       {
  -    if ( _bundle == null )
  -        {
  -        BundleTag bundleTag = (BundleTag)this.findAncestorWithClass(this,BundleTag.class);
  -        if (bundleTag != null)
  -            {
  -            _bundle = bundleTag.getBundle();
  -            }
  +        _arguments.add(arg);
  +        if (_debug) {
  +            ServletContext sc = pageContext.getServletContext();
  +            sc.log("i18n:message added arg: " + arg.toString());
           }
  -    if ( _bundle == null )
  -        {
  -        _bundle = ResourceHelper.getBundle(pageContext);
  -        }
  -    return _bundle;
       }
   
  -  /**
  -   * Turn debugging log messages on or off
  -   */
  -  public void setDebug(boolean value)
  +    /**
  +     *  allows setting all the arguments at once
  +     */
  +    public final void setArgs(Object[] args)
       {
  -    _debug = value;
  +        _args = args;
       }
   
  -  public boolean getDebug()
  +    /**
  +     *  clears the argument list so that sub tags can call addArgument
  +     *  clears out any previous key and value in case key is not provided,
  +     *  or the value is null
  +     */
  +    public final void release()
       {
  -    return _debug;
  +        super.release();
  +        _arguments.clear();
  +        _key = null;
  +        _value = null;
  +        _bundle = null;
       }
  -  
   
     /**
  -   *  adds to the list of arguments used when formatting the message
  +   *  locates the bundle and gets the value
      */
  -  public void addArg(Object arg)
  +  public final int doStartTag() throws JspException
       {
  -    _arguments.add(arg);
  -    if (_debug)
  -      {
  -      ServletContext sc = pageContext.getServletContext();
  -      sc.log("i18n:message added arg: " + arg.toString());
  -      }
  -    }
  +       // Reset value for resource bundle key
  +       _value = null;
   
  -  /**
  -   *  allows setting all the arguments at once
  -   */
  -  public void setArgs(Object[] args)
  -    {
  -    _arguments.addAll(Arrays.asList(args));
  -    }
  +       // ensure we have a key
  +        if ( _key == null ) {
  +            throw new JspTagException("i18n:message tag requires a key attribute.");
  +        }
   
  -  /**
  -   *  clears the argument list so that sub tags can call addArgument
  -   *  clears out any previous key and value in case key is not provided,
  -   *  or the value is null
  -   */
  -  public void release()
  -    {
  -    super.release();
  -    _arguments.clear();
  -    _key = null;
  -    _value = null;
  -    _bundle = null;
  -    }
  +        ResourceBundle bundle = this.getBundle();
  +        if ( bundle == null ) {
  +            throw new JspTagException(
  +                "i18n:message tag, no bundle available for use.");
  +        }
   
  -  /**
  -   *  locates the bundle and gets the value
  -   */
  -  public int doStartTag()
  -          throws JspException
  -    {
  -    String key = this.getKey();
  -    ResourceBundle bundle = this.getBundle();
  -    
  -    // ensure we have a key
  -    if ( key == null )
  -        {
  -        throw new JspException("MessageTag requires a key.");
  -        }
  -
  -    // ensure a bundle was defined
  -    if ( bundle == null )
  -        {
  -        throw new JspException("A bundle must be defined by the BundleTag prior to using a MessageTag.");
  -        }
  -
  -    // see if the bundle has a value, if not, we default to the tag contents
  -    try
  -        {
  -        _value = bundle.getString(key);
  -        if (_debug)
  -          {
  -          ServletContext sc = pageContext.getServletContext();
  -          sc.log("i18n: message: template for " + key + " is: " + _value);
  -          }
  -        }
  -    catch (java.util.MissingResourceException e)
  -        {
  -        ServletContext sc = pageContext.getServletContext();
  -        sc.log("value not found for key:" + key);
  +        // Reset the arguments
  +        _arguments.clear();
  +        if ( _args != null ) {
  +            _arguments.addAll(Arrays.asList(_args));
           }
   
  -    return BodyTag.EVAL_BODY_TAG;
  +        // see if the bundle has a value, if not, we default to the tag contents
  +        try {
  +            _value = bundle.getString(_key);
  +            if (_debug) {
  +                ServletContext sc = pageContext.getServletContext();
  +                sc.log("i18n:message tag: template for " + _key + " is: " + _value);
  +            }
  +        } catch (java.util.MissingResourceException e) {
  +            ServletContext sc = pageContext.getServletContext();
  +            sc.log("i18n:message tag, value not found for key:" + _key);
  +        }
  +
  +        return EVAL_BODY_TAG;
       }
   
  -  /**
  -   *  Performs the proper runtime substitution. If an id attribute was
  -   *  specified, then it is assumed that this tag is merely defining a
  -   *  string variable; otherwise output is provided.
  -   */
  -  public int doEndTag()
  -          throws JspException
  +    /**
  +     *  Performs the proper runtime substitution. If an id attribute was
  +     *  specified, then it is assumed that this tag is merely defining a
  +     *  string variable; otherwise output is provided.
  +     */
  +    public final int doEndTag() throws JspException
       {
  -    try
  -        {
  -        // if the value is null, use the body content
  -        if ( _value == null )
  -            {
  -            _value = bodyContent.getString();
  +        try {
  +            // if the value is null, use the body content
  +            if ( _value == null ) {
  +                _value = bodyContent.getString();
  +                bodyContent.clear();
               }
   
  -        // perform parameter substitutions
  -        if ( _value != null && _arguments != null )
  -            {
  -            // reformat the value as specified
  -            _messageFormat.setLocale(_bundle.getLocale());
  -            _messageFormat.applyPattern(_value);
  -            _value = _messageFormat.format(_arguments.toArray());
  +            // perform parameter substitutions
  +            if ( _value != null && _arguments != null && _arguments.size() > 0) {
  +                // reformat the value as specified
  +                _messageFormat.setLocale(_bundle.getLocale());
  +                _messageFormat.applyPattern(_value);
  +                _value = _messageFormat.format(_arguments.toArray());
               }
   
  -        if ( _value == null)
  -            {
  -            if (_debug)
  -                {
  -                ServletContext sc = pageContext.getServletContext();
  -                String key = this.getKey();
  -                sc.log("i18n: message: skipping null value for " + key);
  +            if ( _value == null) {
  +                if (_debug) {
  +                    ServletContext sc = pageContext.getServletContext();
  +                    sc.log("i18n: message: skipping null value for " + _key);
                   }
  +            } else if (id != null) {
  +                // define the variable in the page context
  +                pageContext.setAttribute(id,_value);
  +            } else {
  +                // print the value to the JspWriter
  +                this.pageContext.getOut().print(_value);
               }
  -        else if (id != null)
  -            {
  -            // define the variable in the page context
  -            pageContext.setAttribute(id,_value);
  -            }
  -        else
  -            {
  -            // print the value to the JspWriter
  -            this.pageContext.getOut().print(_value);
  -            }
  -        }
  -    catch (java.io.IOException e)
  -        {
  -        throw new JspException("IO Error: " + e.getMessage());
  +        } catch (java.io.IOException e) {
  +            throw new JspTagException("i18n:message tag IO Error: " + e.getMessage());
           }
   
  -    // only process the body once
  -    return BodyTag.EVAL_PAGE;
  +        // only process the body once
  +        return EVAL_PAGE;
       }
   
  -
  -  } // MessageTag
  +}
  
  
  
  1.6       +16 -1     jakarta-taglibs/i18n/xml/i18n.xml
  
  Index: i18n.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/i18n/xml/i18n.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- i18n.xml	19 Jan 2002 07:33:38 -0000	1.5
  +++ i18n.xml	17 Dec 2002 04:19:00 -0000	1.6
  @@ -438,7 +438,12 @@
         <description>
           The messageArg tag is a simpler (and usually more readable) alternative
           to using the Message tag's args attribute for specifying arguments to
  -        MessageFormat.
  +        MessageFormat. Note that if you use arguments for your message tags,
  +        java.util.MessageFormat puts some restrictions on the characters you
  +        are allowed to use.  The one that is most likely to affect you is the
  +        requirement that single apostrophies should be escaped by another
  +        apostrophe (so, you replace ' with '' in your resource bundle
  +        properties file).
         </description>
         <summary>
           Specifies arguments to be used by the message tag's MessageFormat.
  @@ -1386,6 +1391,16 @@
     </tagtoc>
   
   </taglib>
  +
  +<revision release="Development" date="12/16/2002">
  +  <description>
  +    Went through all the bugzilla bug reports and applied patches
  +    and fixed bugs in the message, bundle, and locale tags.  Many
  +    of the bug fixes were related to this taglib working in JSP
  +    containers which implement custom tag pooling. No
  +    new features or enhancement requests were worked on.
  +  </description>
  +</revision>
   
   <revision release="Development" date="5/14/2001">
     <description>
  
  
  

--
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