You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ol...@apache.org on 2020/04/09 23:05:08 UTC

[tomcat-taglibs-standard] tag standard-104_2 created (now 10a81cf)

This is an automated email from the ASF dual-hosted git repository.

olamy pushed a change to tag standard-104_2
in repository https://gitbox.apache.org/repos/asf/tomcat-taglibs-standard.git.


      at 10a81cf  (commit)
This tag includes the following new commits:

     new 715e048  This commit was manufactured by cvs2svn to create tag 'standard-104_2'.
     new 10a81cf  Moving the Standard taglib over to Tomcat

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



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


[tomcat-taglibs-standard] 02/02: Moving the Standard taglib over to Tomcat

Posted by ol...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

olamy pushed a commit to tag standard-104_2
in repository https://gitbox.apache.org/repos/asf/tomcat-taglibs-standard.git

commit 10a81cf60fd4b99a919feeb08dce3fbfe5e98e99
Author: Henri Yandell <ba...@apache.org>
AuthorDate: Mon Aug 17 04:16:09 2009 +0000

    Moving the Standard taglib over to Tomcat


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


[tomcat-taglibs-standard] 01/02: This commit was manufactured by cvs2svn to create tag 'standard-104_2'.

Posted by ol...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

olamy pushed a commit to tag standard-104_2
in repository https://gitbox.apache.org/repos/asf/tomcat-taglibs-standard.git

commit 715e048e3353e7c46cf2a62523c6140e4cfb5b75
Author: no_author <de...@apache.org>
AuthorDate: Tue Sep 23 21:41:38 2003 +0000

    This commit was manufactured by cvs2svn to create tag
    'standard-104_2'.
---
 build.xml                                          |   2 +-
 doc/web/ReleaseNotes.html                          |  53 ++++++-
 examples/web/format/Demo.jsp                       | 116 ++++++++++++++
 examples/web/format/index.html                     |   3 +
 .../jsp/jstl/core/ConditionalTagSupport.java       |   4 +-
 src/javax/servlet/jsp/jstl/core/Config.java        |  13 +-
 src/org/apache/taglibs/standard/Version.java       | 169 +++++++++++++++++++++
 .../tag/common/fmt/FormatNumberSupport.java        |   7 +-
 .../standard/tag/common/fmt/MessageSupport.java    |  40 +++--
 .../standard/tag/common/fmt/SetLocaleSupport.java  |   4 +-
 .../standard/tag/common/sql/QueryTagSupport.java   |   1 +
 .../taglibs/standard/tag/el/fmt/MessageTag.java    |  18 +--
 .../taglibs/standard/tag/rt/fmt/MessageTag.java    |   4 +-
 .../apache/taglibs/standard/tlv/JstlSqlTLV.java    |   3 +-
 14 files changed, 386 insertions(+), 51 deletions(-)

diff --git a/build.xml b/build.xml
index 80a6e6b..85f31e6 100644
--- a/build.xml
+++ b/build.xml
@@ -52,7 +52,7 @@
     <!-- Make sure required dependencies are available -->
     <antcall target="checkRequiredFile">
        <param name="file" value="${servlet23.jar}"/>
-       <param name="fail.message" value="A jar file containing the Servlet 2.3 and JSP1.2 classes is required to compile the Standard Taglib.  Please define the property servlet23.jar in your build.properties file and ensure that the file exists."/>
+       <param name="fail.message" value="A jar file containing the Servlet 2.3 and JSP1.2 classes is required to compile the Standard Taglib.  ${servlet23.jar}  Please define the property servlet23.jar in your build.properties file and ensure that the file exists."/>
     </antcall>
     <antcall target="checkRequiredFile">
        <param name="file" value="${jdbc2_0-stdext.jar}"/>     
diff --git a/doc/web/ReleaseNotes.html b/doc/web/ReleaseNotes.html
index d4e761b..352584b 100644
--- a/doc/web/ReleaseNotes.html
+++ b/doc/web/ReleaseNotes.html
@@ -9,24 +9,22 @@
 <h1>
 Standard: An Implementation of the JSP&#153; Standard Tag Library (JSTL)<br>
 <p>
-Version: 1.0.4-dev (In Development)<br>
+Version: 1.0.4<br>
 Release Notes
 </h1>
 </center>
 
-<p>The Standard 1.0.4-dev release is a minor update to the Standard 1.0.3
+<p>The Standard 1.0.4 release is a minor update to the Standard 1.0.3
 release, which builds on the Standard 1.0 FCS release, an 
 implementation of the final <a href="http://java.sun.com/products/jstl">JSTL 1.0 Specification</a>. The Standard
-1.0.4-dev release includes many bug fixes and updates. An official release of
-JSTL 1.0.4 should happen once important bugs have been fixed and the release is
-stable.</p>
+1.0.4 release includes many bug fixes and updates.</p>
 
 <p>The Standard Taglib, which is hosted at Apache, is used as the source repository for the <a href="http://java.sun.com/products/jstl">JSTL 1.0 reference implementation</a> supplied by Sun Microsystems, Inc.</p>
 <hr/>
 
 <h2>Release History</h2>
 
-<dt><b>As of Today &#149; Standard 1.0.4-dev nightly</b></dt>
+<dt><b>September 2003 &#149; Standard 1.0.4</b></dt>
 <p><dd>Bugs fixed since Standard 1.0.3 Taglib release:</dd>
 <ul>
   <blockquote>
@@ -40,20 +38,59 @@ stable.</p>
       <tr>
         <td width="27%" height="15">
           <div align="center"><a
-href="http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16069">16912</a></div>
+href="http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16912">16912</a></div>
         </td>
         <td width="73%" height="15">
         We take advantage of the new method URLEncoder.encode(String,String) if running on J2SE 1.4.
         &lt;c:param&gt; will then use the proper encoding.
         </td>
       </tr>
+      <tr>
+        <td width="27%" height="15">
+          <div align="center"><a
+href="http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17440">17440</a></div>
+        </td>
+        <td width="73%" height="15">
+        Resource bundle that only differs with the variant of the locale will
+now be properly selected.
+        </td>
+      </tr>
+      <tr>
+        <td width="27%" height="15">
+          <div align="center"><a
+href="http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20197">20197</a></div>
+        </td>
+        <td width="73%" height="15">
+<sql:setDataSource> did not allow the specification of a scope without
+a var attribute to set the SQl DataSource configuration setting. Fixed.
+        </td>
+      </tr>    
+      <tr>
+        <td width="27%" height="15">
+          <div align="center"><a
+href="http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22034">22034</a></div>
+        </td>
+        <td width="73%" height="15">
+Page scope not properly set with &lt;c:if&gt;. Fixed.
+        </td>
+      </tr>    
+      <tr>
+        <td width="27%" height="15">
+          <div align="center"><a
+href="http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21188">21188</a></div>
+        </td>
+        <td width="73%" height="15">
+Config.find() fails on invalidated sessions. Fixed.
+        </td>
+      </tr>    
     </table>
   </blockquote>
 </ul>
+
 <blockquote> 
   <p>Other changes and additions:</p>
   <ul>
-    <li>TBD</li>
+    <li>Added Version class to easily tell the version of the jar file.</li>
   </ul>
 </blockquote>
 
diff --git a/examples/web/format/Demo.jsp b/examples/web/format/Demo.jsp
new file mode 100644
index 0000000..60fe24e
--- /dev/null
+++ b/examples/web/format/Demo.jsp
@@ -0,0 +1,116 @@
+<%@ page import="javax.servlet.jsp.jstl.core.Config, java.util.*" %>
+
+<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
+
+<html>
+<head>
+  <title>JSTL: Formatting/I18N Support -- Demo Example</title>
+</head>
+<body bgcolor="#FFFFFF">
+
+<h3>Demo</h3>
+
+<c:if test="${!empty param.locale}">
+  <fmt:setLocale value="${param.locale}" scope="page"/>
+</c:if>
+
+<c:if test="${!empty param.fallback}">
+  <% Config.set(request, Config.FMT_FALLBACK_LOCALE, request.getParameter("fallback")); %>
+</c:if>
+
+<table>
+<tr>
+  <td><b>Set application-based locale:</b></td>
+  <td>
+<a href='?locale=en&fallback=<c:out value="${param.fallback}"/>'>English</a> &#149;
+<a href='?locale=fr&fallback=<c:out value="${param.fallback}"/>'>French</a> &#149;
+<a href='?locale=de&fallback=<c:out value="${param.fallback}"/>'>German</a> &#149;
+<a href='?locale=it&fallback=<c:out value="${param.fallback}"/>'>Italian</a> &#149;
+<a href='?locale=es&fallback=<c:out value="${param.fallback}"/>'>Spanish (no bundle)</a> &#149;
+<a href='?locale=&fallback=<c:out value="${param.fallback}"/>'>None</a>
+  </td>
+</tr>
+<tr>
+  <td align="right"><b>Set fallback locale:</b></td>
+  <td>
+<a href='?locale=<c:out value="${param.locale}"/>&fallback=en'>English</a> &#149;
+<a href='?locale=<c:out value="${param.locale}"/>&fallback=fr'>French</a> &#149;
+<a href='?locale=<c:out value="${param.locale}"/>&fallback=de'>German</a> &#149;
+<a href='?locale=<c:out value="${param.locale}"/>&fallback=it'>Italian</a> &#149;
+<a href='?locale=<c:out value="${param.locale}"/>&fallback=es'>Spanish (no bundle)</a> &#149;
+<a href='?locale=<c:out value="${param.locale}"/>&fallback='>None</a>
+  </td>
+</table>
+<p>
+
+Request parameter "locale": <c:out value="${param.locale}"/><br>
+<i>(This value is used to set the application based locale for this example)</i>
+<p>
+
+Application based locale: <%=Config.find(pageContext, Config.FMT_LOCALE)%><br>
+<i>(javax.servlet.jsp.jstl.fmt.locale configuration setting)</i>
+<p>
+
+Browser-Based locales: 
+<% 
+  Enumeration enum = request.getLocales();
+  while (enum.hasMoreElements()) {
+    Locale locale = (Locale)enum.nextElement();
+    out.print(locale);
+    out.print(" ");
+  }
+%>
+<br>
+<i>(ServletRequest.getLocales() on the incoming request)</i>
+<p>
+
+Fallback locale: <%=Config.find(pageContext, Config.FMT_FALLBACK_LOCALE)%><br>
+<i>(javax.servlet.jsp.jstl.fmt.fallbackLocale configuration setting)</i>
+<p>
+
+<jsp:useBean id="now" class="java.util.Date" />
+<h4>
+<fmt:formatDate value="${now}" dateStyle="full"/> &#149;
+<fmt:formatDate value="${now}" type="time"/>
+</h4>
+
+<p>
+
+<fmt:bundle basename="org.apache.taglibs.standard.examples.i18n.Resources">
+<table cellpadding="5" border="1">
+  <tr>
+    <th align="left">KEY</th>
+    <th align="left">VALUE</th>
+  </tr>
+  <tr>
+    <td>greetingMorning</td>
+    <td><fmt:message key="greetingMorning"/></td>
+  </tr>
+  <tr>
+    <td>greetingEvening</td>
+    <td><fmt:message key="greetingEvening"/></td>
+  </tr>
+  <tr>
+    <td>currentTime</td>
+    <td>
+      <fmt:message key="currentTime">
+        <fmt:param value="${now}"/>
+      </fmt:message>
+    </td>
+  </tr>
+  <tr>
+    <td>serverInfo</td>
+    <td><fmt:message key="serverInfo"/></td>
+  </tr>
+  <tr>
+    <td>undefinedKey</td>
+    <td><fmt:message key="undefinedKey"/></td>
+  </tr>
+</table>
+</fmt:bundle>
+
+<p>
+
+</body>
+</html>
diff --git a/examples/web/format/index.html b/examples/web/format/index.html
index 7326505..60931a6 100644
--- a/examples/web/format/index.html
+++ b/examples/web/format/index.html
@@ -28,6 +28,9 @@
 </table>
 <!-- #BeginEditable "body" --> 
 <h2>I18N-Capable Formatting Tags Examples</h2>
+<h3>Demo <a href="../ShowSource.jsp?filename=/format/Demo.jsp"><img src="../images/code.gif" width="24" height="24" border="0"></a> 
+  <a href="Demo.jsp"><img src="../images/execute.gif" width="24" height="24" border="0"></a> </h3>
+Overview demo where the locale to be applied to the page may be changed dynamically.<br>
 <h3>German&nbsp;&nbsp; <a href="../ShowSource.jsp?filename=/format/GermanLocale.jsp"><img src="../images/code.gif" width="24" height="24" border="0"></a> 
   <a href="GermanLocale.jsp"><img src="../images/execute.gif" width="24" height="24" border="0"></a> 
 </h3>
diff --git a/src/javax/servlet/jsp/jstl/core/ConditionalTagSupport.java b/src/javax/servlet/jsp/jstl/core/ConditionalTagSupport.java
index 1146ac0..6dac3a2 100644
--- a/src/javax/servlet/jsp/jstl/core/ConditionalTagSupport.java
+++ b/src/javax/servlet/jsp/jstl/core/ConditionalTagSupport.java
@@ -166,7 +166,9 @@ public abstract class ConditionalTagSupport
      * @param scope Scope of the 'var' attribute
      */
     public void setScope(String scope) {
-	if (scope.equalsIgnoreCase("request"))
+	if (scope.equalsIgnoreCase("page"))
+	    this.scope = PageContext.PAGE_SCOPE;
+	else if (scope.equalsIgnoreCase("request"))
 	    this.scope = PageContext.REQUEST_SCOPE;
 	else if (scope.equalsIgnoreCase("session"))
 	    this.scope = PageContext.SESSION_SCOPE;
diff --git a/src/javax/servlet/jsp/jstl/core/Config.java b/src/javax/servlet/jsp/jstl/core/Config.java
index f98274a..7406566 100644
--- a/src/javax/servlet/jsp/jstl/core/Config.java
+++ b/src/javax/servlet/jsp/jstl/core/Config.java
@@ -142,7 +142,7 @@ public class Config {
 	case PageContext.REQUEST_SCOPE:
 	    return pc.getAttribute(name + REQUEST_SCOPE_SUFFIX, scope);
 	case PageContext.SESSION_SCOPE:
-	    return pc.getAttribute(name + SESSION_SCOPE_SUFFIX, scope);
+	    return get(pc.getSession(), name);
 	case PageContext.APPLICATION_SCOPE:
 	    return pc.getAttribute(name + APPLICATION_SCOPE_SUFFIX, scope);
 	default:
@@ -180,10 +180,17 @@ public class Config {
      * @param name Configuration variable name
      *
      * @return The <tt>java.lang.Object</tt> associated with the configuration
-     * variable, or null if it is not defined.
+     * variable, or null if it is not defined, if session is null, or if the session
+     * is invalidated. 
      */
     public static Object get(HttpSession session, String name) {
-	return session.getAttribute(name + SESSION_SCOPE_SUFFIX);
+        Object ret = null;
+        if (session != null) {
+            try {
+                ret = session.getAttribute(name + SESSION_SCOPE_SUFFIX);
+            } catch (IllegalStateException ex) {} // when session is invalidated
+        }
+        return ret;
     }
 
     /**
diff --git a/src/org/apache/taglibs/standard/Version.java b/src/org/apache/taglibs/standard/Version.java
new file mode 100644
index 0000000..2a738cf
--- /dev/null
+++ b/src/org/apache/taglibs/standard/Version.java
@@ -0,0 +1,169 @@
+/*
+ * 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.standard;
+
+/**
+ * [lifted from xalan]
+ * <meta name="usage" content="general"/>
+ * Administrative class to keep track of the version number of
+ * the standard tag library.
+ * <P>This class implements the upcoming standard of having
+ * org.apache.project-name.Version.getVersion() be a standard way 
+ * to get version information.  
+ */
+public class Version
+{
+  /**
+   * Get the basic version string for the current release.
+   * Version String formatted like 
+   * <CODE>"<B>standard-taglib</B> v.r[.dd| <B>D</B>nn]"</CODE>.
+   *
+   * Futurework: have this read version info from jar manifest.
+   *
+   * @return String denoting our current version
+   */
+  public static String getVersion()
+  {
+    return getProduct() + " " +
+           getMajorVersionNum() + "." + getReleaseVersionNum()+ "." +
+           ((getDevelopmentVersionNum() > 0) ? 
+               ("D" + getDevelopmentVersionNum()) : 
+               ("" + getMaintenanceVersionNum()));
+  }
+
+  /**
+   * Print the processor version to the command line.
+   *
+   * @param argv command line arguments, unused.
+   */
+  public static void main(String argv[])
+  {
+    System.out.println(getVersion());
+  }
+
+  /**
+   * Name of product
+   */
+  public static String getProduct()
+  {
+    return "standard-taglib";
+  }
+
+  /**
+   * Major version number.
+   * Version number. This changes only when there is a
+   *          significant, externally apparent enhancement from
+   *          the previous release. 'n' represents the n'th
+   *          version.
+   *
+   *          Clients should carefully consider the implications
+   *          of new versions as external interfaces and behaviour
+   *          may have changed.
+   */
+  public static int getMajorVersionNum()
+  {
+      return 1;
+  }
+
+  /**
+   * Release Number.
+   * Release number. This changes when:
+   *            -  a new set of functionality is to be added, eg,
+   *               implementation of a new W3C specification.
+   *            -  API or behaviour change.
+   *            -  its designated as a reference release.
+   */
+  public static int getReleaseVersionNum()
+  {
+    return 0;
+  }
+
+  /**
+   * Maintenance Drop Number.
+   * Optional identifier used to designate maintenance
+   *          drop applied to a specific release and contains
+   *          fixes for defects reported. It maintains compatibility
+   *          with the release and contains no API changes.
+   *          When missing, it designates the final and complete
+   *          development drop for a release.
+   */
+  public static int getMaintenanceVersionNum()
+  {
+    return 4;
+  }
+
+  /**
+   * Development Drop Number.
+   * Optional identifier designates development drop of
+   *          a specific release. D01 is the first development drop
+   *          of a new release.
+   *
+   *          Development drops are works in progress towards a
+   *          compeleted, final release. A specific development drop
+   *          may not completely implement all aspects of a new
+   *          feature, which may take several development drops to
+   *          complete. At the point of the final drop for the
+   *          release, the D suffix will be omitted.
+   *
+   *          Each 'D' drops can contain functional enhancements as
+   *          well as defect fixes. 'D' drops may not be as stable as
+   *          the final releases.
+   */
+  public static int getDevelopmentVersionNum()
+  {
+    return 2;
+  }
+}
diff --git a/src/org/apache/taglibs/standard/tag/common/fmt/FormatNumberSupport.java b/src/org/apache/taglibs/standard/tag/common/fmt/FormatNumberSupport.java
index f983a9b..7901070 100644
--- a/src/org/apache/taglibs/standard/tag/common/fmt/FormatNumberSupport.java
+++ b/src/org/apache/taglibs/standard/tag/common/fmt/FormatNumberSupport.java
@@ -169,7 +169,12 @@ public abstract class FormatNumberSupport extends BodyTagSupport {
 	}
 
 	if ((input == null) || input.equals("")) {
-	    // do nothing
+	    // Spec says:
+            // If value is null or empty, remove the scoped variable 
+            // if it is specified (see attributes var and scope).
+	    if (var != null) {
+	        pageContext.removeAttribute(var, scope);
+            }
 	    return EVAL_PAGE;
 	}
 
diff --git a/src/org/apache/taglibs/standard/tag/common/fmt/MessageSupport.java b/src/org/apache/taglibs/standard/tag/common/fmt/MessageSupport.java
index 00a2123..3c23bb0 100644
--- a/src/org/apache/taglibs/standard/tag/common/fmt/MessageSupport.java
+++ b/src/org/apache/taglibs/standard/tag/common/fmt/MessageSupport.java
@@ -84,9 +84,9 @@ public abstract class MessageSupport extends BodyTagSupport {
     //*********************************************************************
     // Protected state
 
-    protected String key;                         // 'key' attribute
-    protected boolean keySpecified;	          // status
-    protected LocalizationContext locCtxt;        // 'bundle' attribute
+    protected String keyAttrValue;       // 'key' attribute value
+    protected boolean keySpecified;	 // 'key' attribute specified
+    protected LocalizationContext bundleAttrValue; // 'bundle' attribute value
     protected boolean bundleSpecified;   // 'bundle' attribute specified?
 
 
@@ -108,10 +108,12 @@ public abstract class MessageSupport extends BodyTagSupport {
     }
 
     private void init() {
-	key = var = null;
-	keySpecified = false;
-	locCtxt = null;
+	var = null;
 	scope = PageContext.PAGE_SCOPE;
+	keyAttrValue = null;
+	keySpecified = false;
+	bundleAttrValue = null;
+	bundleSpecified = false;
     }
 
 
@@ -144,31 +146,26 @@ public abstract class MessageSupport extends BodyTagSupport {
     // Tag logic
 
     public int doStartTag() throws JspException {
-        if (!bundleSpecified) {
-            // must reset the locCtxt to null so it can be reevaluated
-            // (necessary because the tag may be reused and localization
-            // context used for the tag may have changed).
-            locCtxt = null;
-        }
 	params.clear();
 	return EVAL_BODY_BUFFERED;
     }
 
     public int doEndTag() throws JspException {
 
-        String keyInput = null;
+        String key = null;
+	LocalizationContext locCtxt = null;
 
         // determine the message key by...
         if (keySpecified) {
 	    // ... reading 'key' attribute
-	    keyInput = key;
+	    key = keyAttrValue;
 	} else {
 	    // ... retrieving and trimming our body
 	    if (bodyContent != null && bodyContent.getString() != null)
-	        keyInput = bodyContent.getString().trim();
+	        key = bodyContent.getString().trim();
 	}
 
-	if ((keyInput == null) || keyInput.equals("")) {
+	if ((key == null) || key.equals("")) {
 	    try {
 		pageContext.getOut().print("??????");
 	    } catch (IOException ioe) {
@@ -178,7 +175,7 @@ public abstract class MessageSupport extends BodyTagSupport {
 	}
 
 	String prefix = null;
-	if (locCtxt == null) {
+	if (!bundleSpecified) {
 	    Tag t = findAncestorWithClass(this, BundleSupport.class);
 	    if (t != null) {
 		// use resource bundle from parent <bundle> tag
@@ -190,21 +187,22 @@ public abstract class MessageSupport extends BodyTagSupport {
 	    }
 	} else {
 	    // localization context taken from 'bundle' attribute
+	    locCtxt = bundleAttrValue;
 	    if (locCtxt.getLocale() != null) {
 		SetLocaleSupport.setResponseLocale(pageContext,
 						   locCtxt.getLocale());
 	    }
 	}
 
-	String message = UNDEFINED_KEY + keyInput + UNDEFINED_KEY;
+	String message = UNDEFINED_KEY + key + UNDEFINED_KEY;
 	if (locCtxt != null) {
 	    ResourceBundle bundle = locCtxt.getResourceBundle();
 	    if (bundle != null) {
 		try {
 		    // prepend 'prefix' attribute from parent bundle
 		    if (prefix != null)
-			keyInput = prefix + keyInput;
-		    message = bundle.getString(keyInput);
+			key = prefix + key;
+		    message = bundle.getString(key);
 		    // Perform parametric replacement if required
 		    if (!params.isEmpty()) {
 			Object[] messageArgs = params.toArray();
@@ -216,7 +214,7 @@ public abstract class MessageSupport extends BodyTagSupport {
 			message = formatter.format(messageArgs);
 		    }
 		} catch (MissingResourceException mre) {
-		    message = UNDEFINED_KEY + keyInput + UNDEFINED_KEY;
+		    message = UNDEFINED_KEY + key + UNDEFINED_KEY;
 		}
 	    }
 	}
diff --git a/src/org/apache/taglibs/standard/tag/common/fmt/SetLocaleSupport.java b/src/org/apache/taglibs/standard/tag/common/fmt/SetLocaleSupport.java
index 9f87c19..ae76d55 100644
--- a/src/org/apache/taglibs/standard/tag/common/fmt/SetLocaleSupport.java
+++ b/src/org/apache/taglibs/standard/tag/common/fmt/SetLocaleSupport.java
@@ -235,9 +235,11 @@ public abstract class SetLocaleSupport extends TagSupport {
 	
 	// get response character encoding and store it in session attribute
 	if (pc.getSession() != null) {
-	    pc.setAttribute(RequestEncodingSupport.REQUEST_CHAR_SET,
+            try {
+	        pc.setAttribute(RequestEncodingSupport.REQUEST_CHAR_SET,
 			    response.getCharacterEncoding(),
 			    PageContext.SESSION_SCOPE);
+            } catch (IllegalStateException ex) {} // invalidated session ignored
 	}
     }
  
diff --git a/src/org/apache/taglibs/standard/tag/common/sql/QueryTagSupport.java b/src/org/apache/taglibs/standard/tag/common/sql/QueryTagSupport.java
index b2b2104..81b77c9 100644
--- a/src/org/apache/taglibs/standard/tag/common/sql/QueryTagSupport.java
+++ b/src/org/apache/taglibs/standard/tag/common/sql/QueryTagSupport.java
@@ -247,6 +247,7 @@ public abstract class QueryTagSupport extends BodyTagSupport
 	    setParameters(ps, parameters);
 	    ResultSet rs = ps.executeQuery();
 	    result = new ResultImpl(rs, startRow, maxRows);
+            ps.close();
 	}
 	catch (Throwable e) {
 	    throw new JspException(sqlStatement + ": " + e.getMessage(), e);
diff --git a/src/org/apache/taglibs/standard/tag/el/fmt/MessageTag.java b/src/org/apache/taglibs/standard/tag/el/fmt/MessageTag.java
index 5f4b0fb..6c8f200 100644
--- a/src/org/apache/taglibs/standard/tag/el/fmt/MessageTag.java
+++ b/src/org/apache/taglibs/standard/tag/el/fmt/MessageTag.java
@@ -72,12 +72,6 @@ import org.apache.taglibs.standard.tag.common.fmt.*;
 public class MessageTag extends MessageSupport {
 
     //*********************************************************************
-    // Private constants
-
-    private static final Class OBJECT_ARRAY_CLASS = new Object[0].getClass();
-
-
-    //*********************************************************************
     // Private state (implementation details)
 
     private String key_;                         // stores EL-based property
@@ -123,13 +117,13 @@ public class MessageTag extends MessageSupport {
 
     // for EL-based attribute
     public void setKey(String key_) {
-        this.key_ = key_;
+	this.key_ = key_;
 	this.keySpecified = true;
     }
 
     // for EL-based attribute
     public void setBundle(String bundle_) {
-        this.bundle_ = bundle_;
+	this.bundle_ = bundle_;
         this.bundleSpecified = true;
     }
 
@@ -153,13 +147,13 @@ public class MessageTag extends MessageSupport {
          * propagate up.
          */
 
-	if (key_ != null) {
-	    key = (String) ExpressionEvaluatorManager.evaluate(
+	if (keySpecified) {
+	    keyAttrValue = (String) ExpressionEvaluatorManager.evaluate(
 	        "key", key_, String.class, this, pageContext);
 	}
 
-	if (bundle_ != null) {
-	    locCtxt = (LocalizationContext)
+	if (bundleSpecified) {
+	    bundleAttrValue = (LocalizationContext)
 		ExpressionEvaluatorManager.evaluate(
 	            "bundle", bundle_, LocalizationContext.class, this,
 		    pageContext);
diff --git a/src/org/apache/taglibs/standard/tag/rt/fmt/MessageTag.java b/src/org/apache/taglibs/standard/tag/rt/fmt/MessageTag.java
index 202b2b1..f2a2268 100644
--- a/src/org/apache/taglibs/standard/tag/rt/fmt/MessageTag.java
+++ b/src/org/apache/taglibs/standard/tag/rt/fmt/MessageTag.java
@@ -74,13 +74,13 @@ public class MessageTag extends MessageSupport {
 
     // for tag attribute
     public void setKey(String key) throws JspTagException {
-        this.key = key;
+        this.keyAttrValue = key;
 	this.keySpecified = true;
     }
 
     // for tag attribute
     public void setBundle(LocalizationContext locCtxt) throws JspTagException {
-        this.locCtxt = locCtxt;
+        this.bundleAttrValue = locCtxt;
         this.bundleSpecified = true;
     }
 }
diff --git a/src/org/apache/taglibs/standard/tlv/JstlSqlTLV.java b/src/org/apache/taglibs/standard/tlv/JstlSqlTLV.java
index 39be79d..bc81a59 100644
--- a/src/org/apache/taglibs/standard/tlv/JstlSqlTLV.java
+++ b/src/org/apache/taglibs/standard/tlv/JstlSqlTLV.java
@@ -155,7 +155,8 @@ public class JstlSqlTLV extends JstlBaseTLV {
                     SCOPE, qn, a.getValue(SCOPE))); 
 	    if (qn.startsWith(prefix + ":") && hasEmptyVar(a))
 		fail(Resources.getMessage("TLV_EMPTY_VAR", qn));
-	    if (qn.startsWith(prefix + ":") && hasDanglingScope(a))
+	    if (qn.startsWith(prefix + ":") && hasDanglingScope(a) &&
+                !qn.startsWith(prefix + ":" + SETDATASOURCE))
 		fail(Resources.getMessage("TLV_DANGLING_SCOPE", qn));
 
 	    // now, modify state


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