ASF Bugzilla – Attachment 26304 Details for
Bug 50279
Tab police
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
IDEA reformat of impl module
reformat-impl.patch (text/plain), 750.23 KB, created by
Jeremy Boynes
on 2010-11-17 02:05:43 UTC
(
hide
)
Description:
IDEA reformat of impl module
Filename:
MIME Type:
Creator:
Jeremy Boynes
Created:
2010-11-17 02:05:43 UTC
Size:
750.23 KB
patch
obsolete
>Index: src/test/java/org/apache/taglibs/standard/VersionTest.java >=================================================================== >--- src/test/java/org/apache/taglibs/standard/VersionTest.java (revision 1034807) >+++ src/test/java/org/apache/taglibs/standard/VersionTest.java (working copy) >@@ -17,10 +17,10 @@ > > package org.apache.taglibs.standard; > >-import junit.framework.*; >+import junit.framework.TestCase; > > public class VersionTest >- extends TestCase { >+ extends TestCase { > private Version version = null; > > public VersionTest(String name) { >Index: src/test/java/org/apache/taglibs/standard/functions/FunctionsTest.java >=================================================================== >--- src/test/java/org/apache/taglibs/standard/functions/FunctionsTest.java (revision 1034807) >+++ src/test/java/org/apache/taglibs/standard/functions/FunctionsTest.java (working copy) >@@ -16,15 +16,25 @@ > */ > package org.apache.taglibs.standard.functions; > >+import java.util.Arrays; >+import java.util.Collections; >+ >+import javax.servlet.jsp.JspTagException; >+ > import org.apache.taglibs.standard.resources.Resources; > import org.junit.Assert; > import org.junit.Test; > >-import javax.servlet.jsp.JspTagException; >-import java.util.Arrays; >-import java.util.Collections; >+import static org.apache.taglibs.standard.functions.Functions.endsWith; >+import static org.apache.taglibs.standard.functions.Functions.escapeXml; >+import static org.apache.taglibs.standard.functions.Functions.join; >+import static org.apache.taglibs.standard.functions.Functions.length; >+import static org.apache.taglibs.standard.functions.Functions.replace; >+import static org.apache.taglibs.standard.functions.Functions.split; >+import static org.apache.taglibs.standard.functions.Functions.substring; >+import static org.apache.taglibs.standard.functions.Functions.substringAfter; >+import static org.apache.taglibs.standard.functions.Functions.substringBefore; > >-import static org.apache.taglibs.standard.functions.Functions.*; > /** > */ > public class FunctionsTest { >@@ -104,10 +114,10 @@ > public void testLength() throws Exception { > Assert.assertEquals(0, length(null)); > Assert.assertEquals(0, length("")); >- Assert.assertEquals(3, length(new int[]{1,2,3})); >- Assert.assertEquals(3, length(Arrays.asList(1,2,3))); >- Assert.assertEquals(3, length(Arrays.asList(1,2,3).iterator())); >- Assert.assertEquals(3, length(Collections.enumeration(Arrays.asList(1,2,3)))); >+ Assert.assertEquals(3, length(new int[]{1, 2, 3})); >+ Assert.assertEquals(3, length(Arrays.asList(1, 2, 3))); >+ Assert.assertEquals(3, length(Arrays.asList(1, 2, 3).iterator())); >+ Assert.assertEquals(3, length(Collections.enumeration(Arrays.asList(1, 2, 3)))); > Assert.assertEquals(1, length(Collections.singletonMap("Hello", "World"))); > try { > length(3); >Index: src/test/java/org/apache/taglibs/standard/tag/common/fmt/BundleSupportTest.java >=================================================================== >--- src/test/java/org/apache/taglibs/standard/tag/common/fmt/BundleSupportTest.java (revision 1034807) >+++ src/test/java/org/apache/taglibs/standard/tag/common/fmt/BundleSupportTest.java (working copy) >@@ -36,6 +36,7 @@ > } > > // test for bugzilla #49900 that bodyContent is not released >+ > @Test > public void testBodyContentIsRelease() { > BodyContent b = EasyMock.createMock(BodyContent.class); >Index: src/test/java/org/apache/taglibs/standard/tag/common/core/SetSupportTest.java >=================================================================== >--- src/test/java/org/apache/taglibs/standard/tag/common/core/SetSupportTest.java (revision 1034807) >+++ src/test/java/org/apache/taglibs/standard/tag/common/core/SetSupportTest.java (working copy) >@@ -16,11 +16,7 @@ > */ > package org.apache.taglibs.standard.tag.common.core; > >-import org.apache.taglibs.standard.resources.Resources; >-import org.junit.After; >-import org.junit.Assert; >-import org.junit.Before; >-import org.junit.Test; >+import java.util.Map; > > import javax.el.ELContext; > import javax.el.ExpressionFactory; >@@ -33,7 +29,11 @@ > import javax.servlet.jsp.PageContext; > import javax.servlet.jsp.tagext.BodyContent; > >-import java.util.Map; >+import org.apache.taglibs.standard.resources.Resources; >+import org.junit.After; >+import org.junit.Assert; >+import org.junit.Before; >+import org.junit.Test; > > import static org.easymock.EasyMock.createMock; > import static org.easymock.EasyMock.expect; >Index: src/test/java/org/apache/taglibs/standard/util/EscapeXMLTest.java >=================================================================== >--- src/test/java/org/apache/taglibs/standard/util/EscapeXMLTest.java (revision 1034807) >+++ src/test/java/org/apache/taglibs/standard/util/EscapeXMLTest.java (working copy) >@@ -16,17 +16,18 @@ > */ > package org.apache.taglibs.standard.util; > >+import java.io.IOException; >+import java.io.Reader; >+import java.io.StringReader; >+ >+import javax.servlet.jsp.JspWriter; >+ > import org.junit.Assert; > import org.junit.Before; > import org.junit.Test; > >-import javax.servlet.jsp.JspWriter; >- >-import java.io.IOException; >-import java.io.Reader; >-import java.io.StringReader; >- >-import static org.apache.taglibs.standard.util.EscapeXML.*; >+import static org.apache.taglibs.standard.util.EscapeXML.emit; >+import static org.apache.taglibs.standard.util.EscapeXML.escape; > import static org.easymock.EasyMock.createMock; > import static org.easymock.EasyMock.eq; > import static org.easymock.EasyMock.expect; >Index: src/main/java/org/apache/taglibs/standard/tei/DeclareTEI.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tei/DeclareTEI.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tei/DeclareTEI.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tei; > >@@ -33,15 +33,16 @@ > public class DeclareTEI extends TagExtraInfo { > > // purposely inherit JavaDoc and semantics from TagExtraInfo >+ > @Override > public VariableInfo[] getVariableInfo(TagData data) { > // construct the relevant VariableInfo object > VariableInfo id = new VariableInfo( >- data.getAttributeString("id"), >- data.getAttributeString("type") == null ? >- "java.lang.Object" : data.getAttributeString("type"), >- true, >- VariableInfo.AT_END); >- return new VariableInfo[] { id }; >+ data.getAttributeString("id"), >+ data.getAttributeString("type") == null ? >+ "java.lang.Object" : data.getAttributeString("type"), >+ true, >+ VariableInfo.AT_END); >+ return new VariableInfo[]{id}; > } > } >Index: src/main/java/org/apache/taglibs/standard/tei/ForEachTEI.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tei/ForEachTEI.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tei/ForEachTEI.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tei; > >@@ -37,11 +37,14 @@ > * > * - If 'items' is not specified, 'begin' and 'end' must be > */ >+ > @Override > public boolean isValid(TagData us) { >- if (!Util.isSpecified(us, ITEMS)) >- if (!Util.isSpecified(us, BEGIN) || !(Util.isSpecified(us, END))) >+ if (!Util.isSpecified(us, ITEMS)) { >+ if (!Util.isSpecified(us, BEGIN) || !(Util.isSpecified(us, END))) { > return false; >+ } >+ } > return true; > } > >Index: src/main/java/org/apache/taglibs/standard/tei/ImportTEI.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tei/ImportTEI.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tei/ImportTEI.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tei; > >@@ -33,9 +33,10 @@ > > @Override > public boolean isValid(TagData us) { >- // don't allow both VAR and VAR_READER, together >- if (Util.isSpecified(us, VAR) && Util.isSpecified(us, VAR_READER)) >- return false; >+ // don't allow both VAR and VAR_READER, together >+ if (Util.isSpecified(us, VAR) && Util.isSpecified(us, VAR_READER)) { >+ return false; >+ } > > return true; > } >Index: src/main/java/org/apache/taglibs/standard/tei/Util.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tei/Util.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tei/Util.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tei; > >Index: src/main/java/org/apache/taglibs/standard/tei/XmlParseTEI.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tei/XmlParseTEI.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tei/XmlParseTEI.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tei; > >@@ -35,19 +35,23 @@ > > @Override > public boolean isValid(TagData us) { >- // must have no more than one of VAR and VAR_DOM ... >- if (Util.isSpecified(us, VAR) && Util.isSpecified(us, VAR_DOM)) >- return false; >+ // must have no more than one of VAR and VAR_DOM ... >+ if (Util.isSpecified(us, VAR) && Util.isSpecified(us, VAR_DOM)) { >+ return false; >+ } > >- // ... and must have no less than one of VAR and VAR_DOM >- if (!(Util.isSpecified(us, VAR) || Util.isSpecified(us, VAR_DOM))) >- return false; >+ // ... and must have no less than one of VAR and VAR_DOM >+ if (!(Util.isSpecified(us, VAR) || Util.isSpecified(us, VAR_DOM))) { >+ return false; >+ } > >- // When either 'scope' is specified, its 'var' must be specified >- if (Util.isSpecified(us, SCOPE) && !Util.isSpecified(us, VAR)) >- return false; >- if (Util.isSpecified(us, SCOPE_DOM) && !Util.isSpecified(us, VAR_DOM)) >- return false; >+ // When either 'scope' is specified, its 'var' must be specified >+ if (Util.isSpecified(us, SCOPE) && !Util.isSpecified(us, VAR)) { >+ return false; >+ } >+ if (Util.isSpecified(us, SCOPE_DOM) && !Util.isSpecified(us, VAR_DOM)) { >+ return false; >+ } > > return true; > } >Index: src/main/java/org/apache/taglibs/standard/tei/XmlTransformTEI.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tei/XmlTransformTEI.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tei/XmlTransformTEI.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tei; > >@@ -34,13 +34,15 @@ > > @Override > public boolean isValid(TagData us) { >- // require XSLT >- if (!Util.isSpecified(us, XSLT)) >- return false; >+ // require XSLT >+ if (!Util.isSpecified(us, XSLT)) { >+ return false; >+ } > >- // disallow both VAR and RESULT >- if (Util.isSpecified(us, VAR) && Util.isSpecified(us, RESULT)) >- return false; >+ // disallow both VAR and RESULT >+ if (Util.isSpecified(us, VAR) && Util.isSpecified(us, RESULT)) { >+ return false; >+ } > return true; > } > >Index: src/main/java/org/apache/taglibs/standard/Version.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/Version.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/Version.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard; > >@@ -23,109 +23,101 @@ > * 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. >+ * 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()+ "." + >- getMaintenanceVersionNum() + >- ((getDevelopmentVersionNum() > 0) ? >- ("_D" + getDevelopmentVersionNum()) : ""); >- } >+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>. >+ * <p/> >+ * Futurework: have this read version info from jar manifest. >+ * >+ * @return String denoting our current version >+ */ >+ public static String getVersion() { >+ return getProduct() + " " + >+ getMajorVersionNum() + "." + getReleaseVersionNum() + "." + >+ getMaintenanceVersionNum() + >+ ((getDevelopmentVersionNum() > 0) ? >+ ("_D" + getDevelopmentVersionNum()) : ""); >+ } > >- /** >- * Print the processor version to the command line. >- * >- * @param argv command line arguments, unused. >- */ >- public static void main(String argv[]) >- { >- System.out.println(getVersion()); >- } >+ /** >+ * 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"; >- } >+ /** >+ * 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; >- } >+ /** >+ * 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. >+ * <p/> >+ * 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 2; >- } >+ /** >+ * 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 2; >+ } > >- /** >- * 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 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 0; >+ } > >- /** >- * 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 0; >- } >+ /** >+ * Development Drop Number. >+ * Optional identifier designates development drop of >+ * a specific release. D01 is the first development drop >+ * of a new release. >+ * <p/> >+ * 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. >+ * <p/> >+ * 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 0; >+ } > } >Index: src/main/java/org/apache/taglibs/standard/tlv/JstlSqlTLV.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tlv/JstlSqlTLV.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tlv/JstlSqlTLV.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tlv; > >@@ -29,7 +29,7 @@ > > /** > * <p>A SAX-based TagLibraryValidator for the JSTL SQL tag library. >- * >+ * > * @author Shawn Bayern > */ > public class JstlSqlTLV extends JstlBaseTLV { >@@ -54,10 +54,11 @@ > > //********************************************************************* > // set its type and delegate validation to super-class >+ > @Override >- public ValidationMessage[] validate( >- String prefix, String uri, PageData page) { >- return super.validate( TYPE_SQL, prefix, uri, page ); >+ public ValidationMessage[] validate( >+ String prefix, String uri, PageData page) { >+ return super.validate(TYPE_SQL, prefix, uri, page); > } > > >@@ -66,72 +67,82 @@ > > @Override > protected DefaultHandler getHandler() { >- return new Handler(); >+ return new Handler(); > } > > > //********************************************************************* > // SAX event handler > >- /** The handler that provides the base of our implementation. */ >+ /** >+ * The handler that provides the base of our implementation. >+ */ > private class Handler extends DefaultHandler { > >- // parser state >- private int depth = 0; >+ // parser state >+ private int depth = 0; > private Stack queryDepths = new Stack(); > private Stack updateDepths = new Stack(); > private Stack transactionDepths = new Stack(); >- private String lastElementName = null; >- private boolean bodyNecessary = false; >- private boolean bodyIllegal = false; >+ private String lastElementName = null; >+ private boolean bodyNecessary = false; >+ private boolean bodyIllegal = false; > >- // process under the existing context (state), then modify it >- @Override >- public void startElement( >- String ns, String ln, String qn, Attributes a) { >+ // process under the existing context (state), then modify it > >- // substitute our own parsed 'ln' if it's not provided >- if (ln == null) >- ln = getLocalPart(qn); >+ @Override >+ public void startElement( >+ String ns, String ln, String qn, Attributes a) { > >- // for simplicity, we can ignore <jsp:text> for our purposes >- // (don't bother distinguishing between it and its characters) >- if (qn.equals(JSP_TEXT)) >- return; >+ // substitute our own parsed 'ln' if it's not provided >+ if (ln == null) { >+ ln = getLocalPart(qn); >+ } > >- // check body-related constraint >- if (bodyIllegal) >- fail(Resources.getMessage("TLV_ILLEGAL_BODY", lastElementName)); >+ // for simplicity, we can ignore <jsp:text> for our purposes >+ // (don't bother distinguishing between it and its characters) >+ if (qn.equals(JSP_TEXT)) { >+ return; >+ } > >- // validate expression syntax if we need to >- Set expAtts; >- if (qn.startsWith(prefix + ":") >- && (expAtts = (Set) config.get(ln)) != null) { >- for (int i = 0; i < a.getLength(); i++) { >- String attName = a.getLocalName(i); >- if (expAtts.contains(attName)) { >- String vMsg = >- validateExpression( >- ln, >- attName, >- a.getValue(i)); >- if (vMsg != null) >- fail(vMsg); >- } >- } >- } >+ // check body-related constraint >+ if (bodyIllegal) { >+ fail(Resources.getMessage("TLV_ILLEGAL_BODY", lastElementName)); >+ } > >+ // validate expression syntax if we need to >+ Set expAtts; >+ if (qn.startsWith(prefix + ":") >+ && (expAtts = (Set) config.get(ln)) != null) { >+ for (int i = 0; i < a.getLength(); i++) { >+ String attName = a.getLocalName(i); >+ if (expAtts.contains(attName)) { >+ String vMsg = >+ validateExpression( >+ ln, >+ attName, >+ a.getValue(i)); >+ if (vMsg != null) { >+ fail(vMsg); >+ } >+ } >+ } >+ } >+ > // validate attributes >- if (qn.startsWith(prefix + ":") && !hasNoInvalidScope(a)) >+ if (qn.startsWith(prefix + ":") && !hasNoInvalidScope(a)) { > fail(Resources.getMessage("TLV_INVALID_ATTRIBUTE", >- SCOPE, qn, a.getValue(SCOPE))); >- if (qn.startsWith(prefix + ":") && hasEmptyVar(a)) >- fail(Resources.getMessage("TLV_EMPTY_VAR", qn)); >- if (qn.startsWith(prefix + ":") && hasDanglingScope(a) && >- !qn.startsWith(prefix + ":" + SETDATASOURCE)) >- fail(Resources.getMessage("TLV_DANGLING_SCOPE", qn)); >+ SCOPE, qn, a.getValue(SCOPE))); >+ } >+ if (qn.startsWith(prefix + ":") && hasEmptyVar(a)) { >+ fail(Resources.getMessage("TLV_EMPTY_VAR", qn)); >+ } >+ if (qn.startsWith(prefix + ":") && hasDanglingScope(a) && >+ !qn.startsWith(prefix + ":" + SETDATASOURCE)) { >+ fail(Resources.getMessage("TLV_DANGLING_SCOPE", qn)); >+ } > >- // now, modify state >+ // now, modify state > > /* > * Make sure <sql:param> is nested inside <sql:query> or >@@ -145,8 +156,8 @@ > * </c:forEach> > * </sql:query> > */ >- if ( (isSqlTag(ns, ln, PARAM) || isSqlTag(ns, ln, DATEPARAM)) >- && (queryDepths.empty() && updateDepths.empty()) ) { >+ if ((isSqlTag(ns, ln, PARAM) || isSqlTag(ns, ln, DATEPARAM)) >+ && (queryDepths.empty() && updateDepths.empty())) { > fail(Resources.getMessage("SQL_PARAM_OUTSIDE_PARENT")); > } > >@@ -163,9 +174,9 @@ > transactionDepths.push(new Integer(depth)); > } > >- // set up a check against illegal attribute/body combinations >- bodyIllegal = false; >- bodyNecessary = false; >+ // set up a check against illegal attribute/body combinations >+ bodyIllegal = false; >+ bodyNecessary = false; > > if (isSqlTag(ns, ln, QUERY) || isSqlTag(ns, ln, UPDATE)) { > if (!hasAttribute(a, SQL)) { >@@ -180,41 +191,45 @@ > bodyIllegal = true; > } > >- // record the most recent tag (for error reporting) >- lastElementName = qn; >- lastElementId = a.getValue("http://java.sun.com/JSP/Page", "id"); >+ // record the most recent tag (for error reporting) >+ lastElementName = qn; >+ lastElementId = a.getValue("http://java.sun.com/JSP/Page", "id"); > >- // we're a new element, so increase depth >- depth++; >- } >+ // we're a new element, so increase depth >+ depth++; >+ } > >- @Override >- public void characters(char[] ch, int start, int length) { >+ @Override >+ public void characters(char[] ch, int start, int length) { > >- bodyNecessary = false; // body is no longer necessary! >+ bodyNecessary = false; // body is no longer necessary! > >- // ignore strings that are just whitespace >- String s = new String(ch, start, length).trim(); >- if (s.equals("")) >- return; >+ // ignore strings that are just whitespace >+ String s = new String(ch, start, length).trim(); >+ if (s.equals("")) { >+ return; >+ } > >- // check and update body-related constraints >- if (bodyIllegal) >- fail(Resources.getMessage("TLV_ILLEGAL_BODY", lastElementName)); >- } >+ // check and update body-related constraints >+ if (bodyIllegal) { >+ fail(Resources.getMessage("TLV_ILLEGAL_BODY", lastElementName)); >+ } >+ } > >- @Override >- public void endElement(String ns, String ln, String qn) { >+ @Override >+ public void endElement(String ns, String ln, String qn) { > >- // consistently, we ignore JSP_TEXT >- if (qn.equals(JSP_TEXT)) >- return; >+ // consistently, we ignore JSP_TEXT >+ if (qn.equals(JSP_TEXT)) { >+ return; >+ } > >- // handle body-related invariant >- if (bodyNecessary) >- fail(Resources.getMessage("TLV_MISSING_BODY", >- lastElementName)); >- bodyIllegal = false; // reset: we've left the tag >+ // handle body-related invariant >+ if (bodyNecessary) { >+ fail(Resources.getMessage("TLV_MISSING_BODY", >+ lastElementName)); >+ } >+ bodyIllegal = false; // reset: we've left the tag > > // update <query>-related state > if (isSqlTag(ns, ln, QUERY)) { >@@ -229,8 +244,8 @@ > transactionDepths.pop(); > } > >- // update our depth >- depth--; >- } >+ // update our depth >+ depth--; >+ } > } > } >Index: src/main/java/org/apache/taglibs/standard/tlv/JstlXmlTLV.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tlv/JstlXmlTLV.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tlv/JstlXmlTLV.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tlv; > >@@ -30,15 +30,15 @@ > /** > * <p>A SAX-based TagLibraryValidator for the JSTL XML library. > * Currently implements the following checks:</p> >- * >+ * <p/> > * <ul> >- * <li>Expression syntax validation. >- * <li>Choose / when / otherwise constraints</li> >- * <li>Tag bodies that must either be empty or non-empty given >- * particular attributes.</li> >- * <li>Other minor constraints.</li> >+ * <li>Expression syntax validation. >+ * <li>Choose / when / otherwise constraints</li> >+ * <li>Tag bodies that must either be empty or non-empty given >+ * particular attributes.</li> >+ * <li>Other minor constraints.</li> > * </ul> >- * >+ * > * @author Shawn Bayern > */ > public class JstlXmlTLV extends JstlBaseTLV { >@@ -87,10 +87,11 @@ > > //********************************************************************* > // set its type and delegate validation to super-class >+ > @Override >- public ValidationMessage[] validate( >- String prefix, String uri, PageData page) { >- return super.validate( TYPE_XML, prefix, uri, page ); >+ public ValidationMessage[] validate( >+ String prefix, String uri, PageData page) { >+ return super.validate(TYPE_XML, prefix, uri, page); > } > > >@@ -99,43 +100,49 @@ > > @Override > protected DefaultHandler getHandler() { >- return new Handler(); >+ return new Handler(); > } > > > //********************************************************************* > // SAX event handler > >- /** The handler that provides the base of our implementation. */ >+ /** >+ * The handler that provides the base of our implementation. >+ */ > private class Handler extends DefaultHandler { > >- // parser state >- private int depth = 0; >- private Stack chooseDepths = new Stack(); >- private Stack chooseHasOtherwise = new Stack(); >+ // parser state >+ private int depth = 0; >+ private Stack chooseDepths = new Stack(); >+ private Stack chooseHasOtherwise = new Stack(); > private Stack chooseHasWhen = new Stack(); >- private String lastElementName = null; >- private boolean bodyNecessary = false; >- private boolean bodyIllegal = false; >- private Stack transformWithSource = new Stack(); >+ private String lastElementName = null; >+ private boolean bodyNecessary = false; >+ private boolean bodyIllegal = false; >+ private Stack transformWithSource = new Stack(); > >- // process under the existing context (state), then modify it >- @Override >- public void startElement( >- String ns, String ln, String qn, Attributes a) { >+ // process under the existing context (state), then modify it > >+ @Override >+ public void startElement( >+ String ns, String ln, String qn, Attributes a) { >+ > // substitute our own parsed 'ln' if it's not provided >- if (ln == null) >+ if (ln == null) { > ln = getLocalPart(qn); >+ } > >- // for simplicity, we can ignore <jsp:text> for our purposes >- // (don't bother distinguishing between it and its characters) >- if (qn.equals(JSP_TEXT)) >- return; >+ // for simplicity, we can ignore <jsp:text> for our purposes >+ // (don't bother distinguishing between it and its characters) >+ if (qn.equals(JSP_TEXT)) { >+ return; >+ } > >- // check body-related constraint >- if (bodyIllegal) >- fail(Resources.getMessage("TLV_ILLEGAL_BODY", lastElementName)); >+ // check body-related constraint >+ if (bodyIllegal) { >+ fail(Resources.getMessage("TLV_ILLEGAL_BODY", lastElementName)); >+ } > > // validate expression syntax if we need to > Set expAtts; >@@ -145,166 +152,182 @@ > String attName = a.getLocalName(i); > if (expAtts.contains(attName)) { > String vMsg = >- validateExpression( >- ln, >- attName, >- a.getValue(i)); >- if (vMsg != null) >+ validateExpression( >+ ln, >+ attName, >+ a.getValue(i)); >+ if (vMsg != null) { > fail(vMsg); >+ } > } > } > } > > // validate attributes >- if (qn.startsWith(prefix + ":") && !hasNoInvalidScope(a)) >+ if (qn.startsWith(prefix + ":") && !hasNoInvalidScope(a)) { > fail(Resources.getMessage("TLV_INVALID_ATTRIBUTE", >- SCOPE, qn, a.getValue(SCOPE))); >- if (qn.startsWith(prefix + ":") && hasEmptyVar(a)) >- fail(Resources.getMessage("TLV_EMPTY_VAR", qn)); >- if (qn.startsWith(prefix + ":") && hasDanglingScope(a)) >+ SCOPE, qn, a.getValue(SCOPE))); >+ } >+ if (qn.startsWith(prefix + ":") && hasEmptyVar(a)) { >+ fail(Resources.getMessage("TLV_EMPTY_VAR", qn)); >+ } >+ if (qn.startsWith(prefix + ":") && hasDanglingScope(a)) { > fail(Resources.getMessage("TLV_DANGLING_SCOPE", qn)); >+ } > >- // check invariants for <choose> >- if (chooseChild()) { >+ // check invariants for <choose> >+ if (chooseChild()) { > // mark <choose> for the first the first <when> > if (isXmlTag(ns, ln, WHEN)) { > chooseHasWhen.pop(); > chooseHasWhen.push(Boolean.TRUE); > } > >- // ensure <choose> has the right children >- if(!isXmlTag(ns, ln, WHEN) && !isXmlTag(ns, ln, OTHERWISE)) { >- fail(Resources.getMessage("TLV_ILLEGAL_CHILD_TAG", >- prefix, CHOOSE, qn)); >- } >+ // ensure <choose> has the right children >+ if (!isXmlTag(ns, ln, WHEN) && !isXmlTag(ns, ln, OTHERWISE)) { >+ fail(Resources.getMessage("TLV_ILLEGAL_CHILD_TAG", >+ prefix, CHOOSE, qn)); >+ } > >- // make sure <otherwise> is the last tag >- if (((Boolean) chooseHasOtherwise.peek()).booleanValue()) { >- fail(Resources.getMessage("TLV_ILLEGAL_ORDER", >- qn, prefix, OTHERWISE, CHOOSE)); >- } >- if (isXmlTag(ns, ln, OTHERWISE)) { >- chooseHasOtherwise.pop(); >- chooseHasOtherwise.push(Boolean.TRUE); >- } >+ // make sure <otherwise> is the last tag >+ if (((Boolean) chooseHasOtherwise.peek()).booleanValue()) { >+ fail(Resources.getMessage("TLV_ILLEGAL_ORDER", >+ qn, prefix, OTHERWISE, CHOOSE)); >+ } >+ if (isXmlTag(ns, ln, OTHERWISE)) { >+ chooseHasOtherwise.pop(); >+ chooseHasOtherwise.push(Boolean.TRUE); >+ } > >- } >+ } > >- // Specific check, directly inside <transform source="..."> >- if (!transformWithSource.empty() && >- topDepth(transformWithSource) == (depth - 1)) { >- // only allow <param> >- if (!isXmlTag(ns, ln, PARAM)) >- fail(Resources.getMessage("TLV_ILLEGAL_BODY", >- prefix + ":" + TRANSFORM)); >+ // Specific check, directly inside <transform source="..."> >+ if (!transformWithSource.empty() && >+ topDepth(transformWithSource) == (depth - 1)) { >+ // only allow <param> >+ if (!isXmlTag(ns, ln, PARAM)) { >+ fail(Resources.getMessage("TLV_ILLEGAL_BODY", >+ prefix + ":" + TRANSFORM)); >+ } > >- // thus, if we get the opportunity to hit depth++, >- // we know we've got a <param> subtag >- } >+ // thus, if we get the opportunity to hit depth++, >+ // we know we've got a <param> subtag >+ } > >- // now, modify state >+ // now, modify state > >- // we're a choose, so record new choose-specific state >- if (isXmlTag(ns, ln, CHOOSE)) { >- chooseDepths.push(new Integer(depth)); >+ // we're a choose, so record new choose-specific state >+ if (isXmlTag(ns, ln, CHOOSE)) { >+ chooseDepths.push(new Integer(depth)); > chooseHasWhen.push(Boolean.FALSE); >- chooseHasOtherwise.push(Boolean.FALSE); >- } >+ chooseHasOtherwise.push(Boolean.FALSE); >+ } > >- // set up a check against illegal attribute/body combinations >- bodyIllegal = false; >- bodyNecessary = false; >- if (isXmlTag(ns, ln, PARSE)) { >- if (hasAttribute(a, SOURCE)) >- bodyIllegal = true; >- } else if (isXmlTag(ns, ln, PARAM)) { >- if (hasAttribute(a, VALUE)) >- bodyIllegal = true; >- else >- bodyNecessary = true; >- } else if (isXmlTag(ns, ln, TRANSFORM)) { >- if (hasAttribute(a, SOURCE)) >- transformWithSource.push(new Integer(depth)); >- } >+ // set up a check against illegal attribute/body combinations >+ bodyIllegal = false; >+ bodyNecessary = false; >+ if (isXmlTag(ns, ln, PARSE)) { >+ if (hasAttribute(a, SOURCE)) { >+ bodyIllegal = true; >+ } >+ } else if (isXmlTag(ns, ln, PARAM)) { >+ if (hasAttribute(a, VALUE)) { >+ bodyIllegal = true; >+ } else { >+ bodyNecessary = true; >+ } >+ } else if (isXmlTag(ns, ln, TRANSFORM)) { >+ if (hasAttribute(a, SOURCE)) { >+ transformWithSource.push(new Integer(depth)); >+ } >+ } > >- // record the most recent tag (for error reporting) >- lastElementName = qn; >+ // record the most recent tag (for error reporting) >+ lastElementName = qn; > lastElementId = a.getValue("http://java.sun.com/JSP/Page", "id"); > >- // we're a new element, so increase depth >- depth++; >- } >+ // we're a new element, so increase depth >+ depth++; >+ } > >- @Override >- public void characters(char[] ch, int start, int length) { >+ @Override >+ public void characters(char[] ch, int start, int length) { > >- bodyNecessary = false; // body is no longer necessary! >+ bodyNecessary = false; // body is no longer necessary! > >- // ignore strings that are just whitespace >- String s = new String(ch, start, length).trim(); >- if (s.equals("")) >- return; >+ // ignore strings that are just whitespace >+ String s = new String(ch, start, length).trim(); >+ if (s.equals("")) { >+ return; >+ } > >- // check and update body-related constraints >- if (bodyIllegal) >- fail(Resources.getMessage("TLV_ILLEGAL_BODY", lastElementName)); >+ // check and update body-related constraints >+ if (bodyIllegal) { >+ fail(Resources.getMessage("TLV_ILLEGAL_BODY", lastElementName)); >+ } > >- // make sure <choose> has no non-whitespace text >- if (chooseChild()) { >- String msg = >- Resources.getMessage("TLV_ILLEGAL_TEXT_BODY", >- prefix, CHOOSE, >- (s.length() < 7 ? s : s.substring(0,7))); >- fail(msg); >- } >+ // make sure <choose> has no non-whitespace text >+ if (chooseChild()) { >+ String msg = >+ Resources.getMessage("TLV_ILLEGAL_TEXT_BODY", >+ prefix, CHOOSE, >+ (s.length() < 7 ? s : s.substring(0, 7))); >+ fail(msg); >+ } > > // Specific check, directly inside <transform source="..."> > if (!transformWithSource.empty() >- && topDepth(transformWithSource) == (depth - 1)) { >+ && topDepth(transformWithSource) == (depth - 1)) { > fail(Resources.getMessage("TLV_ILLEGAL_BODY", >- prefix + ":" + TRANSFORM)); >+ prefix + ":" + TRANSFORM)); > } >- } >+ } > >- @Override >- public void endElement(String ns, String ln, String qn) { >+ @Override >+ public void endElement(String ns, String ln, String qn) { > >- // consistently, we ignore JSP_TEXT >- if (qn.equals(JSP_TEXT)) >- return; >+ // consistently, we ignore JSP_TEXT >+ if (qn.equals(JSP_TEXT)) { >+ return; >+ } > >- // handle body-related invariant >- if (bodyNecessary) >- fail(Resources.getMessage("TLV_MISSING_BODY", >- lastElementName)); >- bodyIllegal = false; // reset: we've left the tag >+ // handle body-related invariant >+ if (bodyNecessary) { >+ fail(Resources.getMessage("TLV_MISSING_BODY", >+ lastElementName)); >+ } >+ bodyIllegal = false; // reset: we've left the tag > >- // update <choose>-related state >- if (isXmlTag(ns, ln, CHOOSE)) { >+ // update <choose>-related state >+ if (isXmlTag(ns, ln, CHOOSE)) { > Boolean b = (Boolean) chooseHasWhen.pop(); >- if (!b.booleanValue()) >+ if (!b.booleanValue()) { > fail(Resources.getMessage("TLV_PARENT_WITHOUT_SUBTAG", >- CHOOSE, WHEN)); >- chooseDepths.pop(); >- chooseHasOtherwise.pop(); >- } >+ CHOOSE, WHEN)); >+ } >+ chooseDepths.pop(); >+ chooseHasOtherwise.pop(); >+ } > >- // update <transform source="...">-related state >- if (!transformWithSource.empty() >- && topDepth(transformWithSource) == (depth - 1)) >- transformWithSource.pop(); >+ // update <transform source="...">-related state >+ if (!transformWithSource.empty() >+ && topDepth(transformWithSource) == (depth - 1)) { >+ transformWithSource.pop(); >+ } > >- // update our depth >- depth--; >- } >+ // update our depth >+ depth--; >+ } > >- // are we directly under a <choose>? >- private boolean chooseChild() { >- return (!chooseDepths.empty() >- && (depth - 1) == ((Integer) chooseDepths.peek()).intValue()); >- } >+ // are we directly under a <choose>? > >+ private boolean chooseChild() { >+ return (!chooseDepths.empty() >+ && (depth - 1) == ((Integer) chooseDepths.peek()).intValue()); >+ } >+ > // returns the top int depth (peeked at) from a Stack of Integer >+ > private int topDepth(Stack s) { > return ((Integer) s.peek()).intValue(); > } >Index: src/main/java/org/apache/taglibs/standard/tlv/JstlFmtTLV.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tlv/JstlFmtTLV.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tlv/JstlFmtTLV.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tlv; > >@@ -30,13 +30,13 @@ > /** > * <p>A SAX-based TagLibraryValidator for the JSTL i18n-capable formatting > * library. Currently implements the following checks:</p> >- * >+ * <p/> > * <ul> >- * <li>Expression syntax validation. >- * <li>Tag bodies that must either be empty or non-empty given >- * particular attributes.</li> >+ * <li>Expression syntax validation. >+ * <li>Tag bodies that must either be empty or non-empty given >+ * particular attributes.</li> > * </ul> >- * >+ * > * @author Shawn Bayern > * @author Jan Luehe > */ >@@ -92,10 +92,11 @@ > > //********************************************************************* > // set its type and delegate validation to super-class >+ > @Override >- public ValidationMessage[] validate( >- String prefix, String uri, PageData page) { >- return super.validate( TYPE_FMT, prefix, uri, page ); >+ public ValidationMessage[] validate( >+ String prefix, String uri, PageData page) { >+ return super.validate(TYPE_FMT, prefix, uri, page); > } > > >@@ -104,41 +105,47 @@ > > @Override > protected DefaultHandler getHandler() { >- return new Handler(); >+ return new Handler(); > } > > > //********************************************************************* > // SAX event handler > >- /** The handler that provides the base of our implementation. */ >+ /** >+ * The handler that provides the base of our implementation. >+ */ > private class Handler extends DefaultHandler { > >- // parser state >- private int depth = 0; >- private Stack messageDepths = new Stack(); >- private String lastElementName = null; >- private boolean bodyNecessary = false; >- private boolean bodyIllegal = false; >+ // parser state >+ private int depth = 0; >+ private Stack messageDepths = new Stack(); >+ private String lastElementName = null; >+ private boolean bodyNecessary = false; >+ private boolean bodyIllegal = false; > >- // process under the existing context (state), then modify it >- @Override >- public void startElement( >- String ns, String ln, String qn, Attributes a) { >+ // process under the existing context (state), then modify it > >+ @Override >+ public void startElement( >+ String ns, String ln, String qn, Attributes a) { >+ > // substitute our own parsed 'ln' if it's not provided >- if (ln == null) >+ if (ln == null) { > ln = getLocalPart(qn); >+ } > >- // for simplicity, we can ignore <jsp:text> for our purposes >- // (don't bother distinguishing between it and its characters) >- if (qn.equals(JSP_TEXT)) >- return; >+ // for simplicity, we can ignore <jsp:text> for our purposes >+ // (don't bother distinguishing between it and its characters) >+ if (qn.equals(JSP_TEXT)) { >+ return; >+ } > >- // check body-related constraint >- if (bodyIllegal) >- fail(Resources.getMessage("TLV_ILLEGAL_BODY", >- lastElementName)); >+ // check body-related constraint >+ if (bodyIllegal) { >+ fail(Resources.getMessage("TLV_ILLEGAL_BODY", >+ lastElementName)); >+ } > > // validate expression syntax if we need to > Set expAtts; >@@ -148,114 +155,123 @@ > String attName = a.getLocalName(i); > if (expAtts.contains(attName)) { > String vMsg = >- validateExpression( >- ln, >- attName, >- a.getValue(i)); >- if (vMsg != null) >+ validateExpression( >+ ln, >+ attName, >+ a.getValue(i)); >+ if (vMsg != null) { > fail(vMsg); >+ } > } > } > } > > // validate attributes >- if (qn.startsWith(prefix + ":") && !hasNoInvalidScope(a)) >+ if (qn.startsWith(prefix + ":") && !hasNoInvalidScope(a)) { > fail(Resources.getMessage("TLV_INVALID_ATTRIBUTE", >- SCOPE, qn, a.getValue(SCOPE))); >- if (qn.startsWith(prefix + ":") && hasEmptyVar(a)) >- fail(Resources.getMessage("TLV_EMPTY_VAR", qn)); >+ SCOPE, qn, a.getValue(SCOPE))); >+ } >+ if (qn.startsWith(prefix + ":") && hasEmptyVar(a)) { >+ fail(Resources.getMessage("TLV_EMPTY_VAR", qn)); >+ } > if (qn.startsWith(prefix + ":") >- && !isFmtTag(ns, ln, SETLOCALE) >- && !isFmtTag(ns, ln, SETBUNDLE) >- && !isFmtTag(ns, ln, SETTIMEZONE) >- && hasDanglingScope(a)) >+ && !isFmtTag(ns, ln, SETLOCALE) >+ && !isFmtTag(ns, ln, SETBUNDLE) >+ && !isFmtTag(ns, ln, SETTIMEZONE) >+ && hasDanglingScope(a)) { > fail(Resources.getMessage("TLV_DANGLING_SCOPE", qn)); >+ } > >- /* >- * Make sure <fmt:param> is nested inside <fmt:message>. Note that >- * <fmt:param> does not need to be a direct child of <fmt:message>. >- * Otherwise, the following would not work: >- * >- * <fmt:message key="..." bundle="..."> >- * <c:forEach var="arg" items="..."> >- * <fmt:param value="${arg}"/> >- * </c:forEach> >- * </fmt:message> >- */ >- if (isFmtTag(ns, ln, MESSAGE_PARAM) && messageDepths.empty()) { >- fail(Resources.getMessage("PARAM_OUTSIDE_MESSAGE")); >- } >+ /* >+ * Make sure <fmt:param> is nested inside <fmt:message>. Note that >+ * <fmt:param> does not need to be a direct child of <fmt:message>. >+ * Otherwise, the following would not work: >+ * >+ * <fmt:message key="..." bundle="..."> >+ * <c:forEach var="arg" items="..."> >+ * <fmt:param value="${arg}"/> >+ * </c:forEach> >+ * </fmt:message> >+ */ >+ if (isFmtTag(ns, ln, MESSAGE_PARAM) && messageDepths.empty()) { >+ fail(Resources.getMessage("PARAM_OUTSIDE_MESSAGE")); >+ } > >- // now, modify state >+ // now, modify state > >- // If we're in a <message>, record relevant state >- if (isFmtTag(ns, ln, MESSAGE)) { >- messageDepths.push(new Integer(depth)); >- } >+ // If we're in a <message>, record relevant state >+ if (isFmtTag(ns, ln, MESSAGE)) { >+ messageDepths.push(new Integer(depth)); >+ } > >- // set up a check against illegal attribute/body combinations >- bodyIllegal = false; >- bodyNecessary = false; >- if (isFmtTag(ns, ln, MESSAGE_PARAM) >- || isFmtTag(ns, ln, FORMAT_NUMBER) >- || isFmtTag(ns, ln, PARSE_NUMBER) >- || isFmtTag(ns, ln, PARSE_DATE)) { >- if (hasAttribute(a, VALUE)) >- bodyIllegal = true; >- else >- bodyNecessary = true; >- } else if (isFmtTag(ns, ln, MESSAGE) >- && !hasAttribute(a, MESSAGE_KEY)) { >- bodyNecessary = true; >- } else if (isFmtTag(ns, ln, BUNDLE) >- && hasAttribute(a, BUNDLE_PREFIX)) { >- bodyNecessary = true; >- } >+ // set up a check against illegal attribute/body combinations >+ bodyIllegal = false; >+ bodyNecessary = false; >+ if (isFmtTag(ns, ln, MESSAGE_PARAM) >+ || isFmtTag(ns, ln, FORMAT_NUMBER) >+ || isFmtTag(ns, ln, PARSE_NUMBER) >+ || isFmtTag(ns, ln, PARSE_DATE)) { >+ if (hasAttribute(a, VALUE)) { >+ bodyIllegal = true; >+ } else { >+ bodyNecessary = true; >+ } >+ } else if (isFmtTag(ns, ln, MESSAGE) >+ && !hasAttribute(a, MESSAGE_KEY)) { >+ bodyNecessary = true; >+ } else if (isFmtTag(ns, ln, BUNDLE) >+ && hasAttribute(a, BUNDLE_PREFIX)) { >+ bodyNecessary = true; >+ } > >- // record the most recent tag (for error reporting) >- lastElementName = qn; >+ // record the most recent tag (for error reporting) >+ lastElementName = qn; > lastElementId = a.getValue(JSP, "id"); > >- // we're a new element, so increase depth >- depth++; >- } >+ // we're a new element, so increase depth >+ depth++; >+ } > >- @Override >- public void characters(char[] ch, int start, int length) { >+ @Override >+ public void characters(char[] ch, int start, int length) { > >- bodyNecessary = false; // body is no longer necessary! >+ bodyNecessary = false; // body is no longer necessary! > >- // ignore strings that are just whitespace >- String s = new String(ch, start, length).trim(); >- if (s.equals("")) >- return; >+ // ignore strings that are just whitespace >+ String s = new String(ch, start, length).trim(); >+ if (s.equals("")) { >+ return; >+ } > >- // check and update body-related constraints >- if (bodyIllegal) >- fail(Resources.getMessage("TLV_ILLEGAL_BODY", >- lastElementName)); >- } >+ // check and update body-related constraints >+ if (bodyIllegal) { >+ fail(Resources.getMessage("TLV_ILLEGAL_BODY", >+ lastElementName)); >+ } >+ } > >- @Override >- public void endElement(String ns, String ln, String qn) { >+ @Override >+ public void endElement(String ns, String ln, String qn) { > >- // consistently, we ignore JSP_TEXT >- if (qn.equals(JSP_TEXT)) >- return; >+ // consistently, we ignore JSP_TEXT >+ if (qn.equals(JSP_TEXT)) { >+ return; >+ } > >- // handle body-related invariant >- if (bodyNecessary) >- fail(Resources.getMessage("TLV_MISSING_BODY", >- lastElementName)); >- bodyIllegal = false; // reset: we've left the tag >+ // handle body-related invariant >+ if (bodyNecessary) { >+ fail(Resources.getMessage("TLV_MISSING_BODY", >+ lastElementName)); >+ } >+ bodyIllegal = false; // reset: we've left the tag > >- // update <message>-related state >- if (isFmtTag(ns, ln, MESSAGE)) { >- messageDepths.pop(); >- } >+ // update <message>-related state >+ if (isFmtTag(ns, ln, MESSAGE)) { >+ messageDepths.pop(); >+ } > >- // update our depth >- depth--; >- } >+ // update our depth >+ depth--; >+ } > } > } >Index: src/main/java/org/apache/taglibs/standard/tlv/JstlCoreTLV.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tlv/JstlCoreTLV.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tlv/JstlCoreTLV.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tlv; > >@@ -30,18 +30,18 @@ > /** > * <p>A SAX-based TagLibraryValidator for the core JSTL tag library. > * Currently implements the following checks:</p> >- * >+ * <p/> > * <ul> >- * <li>Expression syntax validation. >- * <li>Choose / when / otherwise constraints</li> >- * <li>Tag bodies that must either be empty or non-empty given >- * particular attributes. (E.g., <set> cannot have a body when >- * 'value' is specified; it *must* have a body otherwise.) For >- * these purposes, "having a body" refers to non-whitespace >- * content inside the tag.</li> >- * <li>Other minor constraints.</li> >+ * <li>Expression syntax validation. >+ * <li>Choose / when / otherwise constraints</li> >+ * <li>Tag bodies that must either be empty or non-empty given >+ * particular attributes. (E.g., <set> cannot have a body when >+ * 'value' is specified; it *must* have a body otherwise.) For >+ * these purposes, "having a body" refers to non-whitespace >+ * content inside the tag.</li> >+ * <li>Other minor constraints.</li> > * </ul> >- * >+ * > * @author Shawn Bayern > */ > public class JstlCoreTLV extends JstlBaseTLV { >@@ -92,10 +92,11 @@ > > //********************************************************************* > // set its type and delegate validation to super-class >+ > @Override >- public ValidationMessage[] validate( >- String prefix, String uri, PageData page) { >- return super.validate( TYPE_CORE, prefix, uri, page ); >+ public ValidationMessage[] validate( >+ String prefix, String uri, PageData page) { >+ return super.validate(TYPE_CORE, prefix, uri, page); > } > > >@@ -104,229 +105,253 @@ > > @Override > protected DefaultHandler getHandler() { >- return new Handler(); >+ return new Handler(); > } > > > //********************************************************************* > // SAX event handler > >- /** The handler that provides the base of our implementation. */ >+ /** >+ * The handler that provides the base of our implementation. >+ */ > private class Handler extends DefaultHandler { > >- // parser state >- private int depth = 0; >- private Stack chooseDepths = new Stack(); >- private Stack chooseHasOtherwise = new Stack(); >- private Stack chooseHasWhen = new Stack(); >+ // parser state >+ private int depth = 0; >+ private Stack chooseDepths = new Stack(); >+ private Stack chooseHasOtherwise = new Stack(); >+ private Stack chooseHasWhen = new Stack(); > private Stack urlTags = new Stack(); >- private String lastElementName = null; >- private boolean bodyNecessary = false; >- private boolean bodyIllegal = false; >+ private String lastElementName = null; >+ private boolean bodyNecessary = false; >+ private boolean bodyIllegal = false; > >- // process under the existing context (state), then modify it >- @Override >- public void startElement( >- String ns, String ln, String qn, Attributes a) { >+ // process under the existing context (state), then modify it > >- // substitute our own parsed 'ln' if it's not provided >- if (ln == null) >- ln = getLocalPart(qn); >+ @Override >+ public void startElement( >+ String ns, String ln, String qn, Attributes a) { > >- // for simplicity, we can ignore <jsp:text> for our purposes >- // (don't bother distinguishing between it and its characters) >- if (isJspTag(ns, ln, TEXT)) >- return; >+ // substitute our own parsed 'ln' if it's not provided >+ if (ln == null) { >+ ln = getLocalPart(qn); >+ } > >- // check body-related constraint >- if (bodyIllegal) >- fail(Resources.getMessage("TLV_ILLEGAL_BODY", lastElementName)); >+ // for simplicity, we can ignore <jsp:text> for our purposes >+ // (don't bother distinguishing between it and its characters) >+ if (isJspTag(ns, ln, TEXT)) { >+ return; >+ } > >- // validate expression syntax if we need to >- Set expAtts; >- if (qn.startsWith(prefix + ":") >- && (expAtts = (Set) config.get(ln)) != null) { >- for (int i = 0; i < a.getLength(); i++) { >- String attName = a.getLocalName(i); >- if (expAtts.contains(attName)) { >- String vMsg = >- validateExpression( >- ln, >- attName, >- a.getValue(i)); >- if (vMsg != null) >- fail(vMsg); >- } >- } >- } >+ // check body-related constraint >+ if (bodyIllegal) { >+ fail(Resources.getMessage("TLV_ILLEGAL_BODY", lastElementName)); >+ } > >+ // validate expression syntax if we need to >+ Set expAtts; >+ if (qn.startsWith(prefix + ":") >+ && (expAtts = (Set) config.get(ln)) != null) { >+ for (int i = 0; i < a.getLength(); i++) { >+ String attName = a.getLocalName(i); >+ if (expAtts.contains(attName)) { >+ String vMsg = >+ validateExpression( >+ ln, >+ attName, >+ a.getValue(i)); >+ if (vMsg != null) { >+ fail(vMsg); >+ } >+ } >+ } >+ } >+ > // validate attributes >- if (qn.startsWith(prefix + ":") && !hasNoInvalidScope(a)) >+ if (qn.startsWith(prefix + ":") && !hasNoInvalidScope(a)) { > fail(Resources.getMessage("TLV_INVALID_ATTRIBUTE", >- SCOPE, qn, a.getValue(SCOPE))); >- if (qn.startsWith(prefix + ":") && hasEmptyVar(a)) >- fail(Resources.getMessage("TLV_EMPTY_VAR", qn)); >- if (qn.startsWith(prefix + ":") && hasDanglingScope(a)) >- fail(Resources.getMessage("TLV_DANGLING_SCOPE", qn)); >+ SCOPE, qn, a.getValue(SCOPE))); >+ } >+ if (qn.startsWith(prefix + ":") && hasEmptyVar(a)) { >+ fail(Resources.getMessage("TLV_EMPTY_VAR", qn)); >+ } >+ if (qn.startsWith(prefix + ":") && hasDanglingScope(a)) { >+ fail(Resources.getMessage("TLV_DANGLING_SCOPE", qn)); >+ } > >- // check invariants for <choose> >- if (chooseChild()) { >- // mark <choose> for the first the first <when> >- if (isCoreTag(ns, ln, WHEN)) { >- chooseHasWhen.pop(); >- chooseHasWhen.push(Boolean.TRUE); >- } >+ // check invariants for <choose> >+ if (chooseChild()) { >+ // mark <choose> for the first the first <when> >+ if (isCoreTag(ns, ln, WHEN)) { >+ chooseHasWhen.pop(); >+ chooseHasWhen.push(Boolean.TRUE); >+ } > >- // ensure <choose> has the right children >- if(!isCoreTag(ns, ln, WHEN) && !isCoreTag(ns, ln, OTHERWISE)) { >- fail(Resources.getMessage("TLV_ILLEGAL_CHILD_TAG", >- prefix, CHOOSE, qn)); >- } >+ // ensure <choose> has the right children >+ if (!isCoreTag(ns, ln, WHEN) && !isCoreTag(ns, ln, OTHERWISE)) { >+ fail(Resources.getMessage("TLV_ILLEGAL_CHILD_TAG", >+ prefix, CHOOSE, qn)); >+ } > >- // make sure <otherwise> is the last tag >- if (((Boolean) chooseHasOtherwise.peek()).booleanValue()) { >- fail(Resources.getMessage("TLV_ILLEGAL_ORDER", >- qn, prefix, OTHERWISE, CHOOSE)); >- } >- if (isCoreTag(ns, ln, OTHERWISE)) { >- chooseHasOtherwise.pop(); >- chooseHasOtherwise.push(Boolean.TRUE); >- } >+ // make sure <otherwise> is the last tag >+ if (((Boolean) chooseHasOtherwise.peek()).booleanValue()) { >+ fail(Resources.getMessage("TLV_ILLEGAL_ORDER", >+ qn, prefix, OTHERWISE, CHOOSE)); >+ } >+ if (isCoreTag(ns, ln, OTHERWISE)) { >+ chooseHasOtherwise.pop(); >+ chooseHasOtherwise.push(Boolean.TRUE); >+ } > >- } >+ } > >- // check constraints for <param> vis-a-vis URL-related tags >- if (isCoreTag(ns, ln, PARAM)) { >- // no <param> outside URL tags. >- if (urlTags.empty() || urlTags.peek().equals(PARAM)) >- fail(Resources.getMessage("TLV_ILLEGAL_ORPHAN", PARAM)); >+ // check constraints for <param> vis-a-vis URL-related tags >+ if (isCoreTag(ns, ln, PARAM)) { >+ // no <param> outside URL tags. >+ if (urlTags.empty() || urlTags.peek().equals(PARAM)) { >+ fail(Resources.getMessage("TLV_ILLEGAL_ORPHAN", PARAM)); >+ } > >- // no <param> where the most recent <import> has a reader >- if (!urlTags.empty() && >- urlTags.peek().equals(IMPORT_WITH_READER)) >- fail(Resources.getMessage("TLV_ILLEGAL_PARAM", >- prefix, PARAM, IMPORT, VAR_READER)); >- } else { >- // tag ISN'T <param>, so it's illegal under non-reader <import> >- if (!urlTags.empty() >- && urlTags.peek().equals(IMPORT_WITHOUT_READER)) >- fail(Resources.getMessage("TLV_ILLEGAL_CHILD_TAG", >- prefix, IMPORT, qn)); >- } >+ // no <param> where the most recent <import> has a reader >+ if (!urlTags.empty() && >+ urlTags.peek().equals(IMPORT_WITH_READER)) { >+ fail(Resources.getMessage("TLV_ILLEGAL_PARAM", >+ prefix, PARAM, IMPORT, VAR_READER)); >+ } >+ } else { >+ // tag ISN'T <param>, so it's illegal under non-reader <import> >+ if (!urlTags.empty() >+ && urlTags.peek().equals(IMPORT_WITHOUT_READER)) { >+ fail(Resources.getMessage("TLV_ILLEGAL_CHILD_TAG", >+ prefix, IMPORT, qn)); >+ } >+ } > >- // now, modify state >+ // now, modify state > >- // we're a choose, so record new choose-specific state >- if (isCoreTag(ns, ln, CHOOSE)) { >- chooseDepths.push(new Integer(depth)); >- chooseHasWhen.push(Boolean.FALSE); >- chooseHasOtherwise.push(Boolean.FALSE); >- } >+ // we're a choose, so record new choose-specific state >+ if (isCoreTag(ns, ln, CHOOSE)) { >+ chooseDepths.push(new Integer(depth)); >+ chooseHasWhen.push(Boolean.FALSE); >+ chooseHasOtherwise.push(Boolean.FALSE); >+ } > >- // if we're introducing a URL-related tag, record it >- if (isCoreTag(ns, ln, IMPORT)) { >- if (hasAttribute(a, VAR_READER)) >- urlTags.push(IMPORT_WITH_READER); >- else >- urlTags.push(IMPORT_WITHOUT_READER); >- } else if (isCoreTag(ns, ln, PARAM)) >- urlTags.push(PARAM); >- else if (isCoreTag(ns, ln, REDIRECT)) >- urlTags.push(REDIRECT); >- else if (isCoreTag(ns, ln, URL)) >- urlTags.push(URL); >+ // if we're introducing a URL-related tag, record it >+ if (isCoreTag(ns, ln, IMPORT)) { >+ if (hasAttribute(a, VAR_READER)) { >+ urlTags.push(IMPORT_WITH_READER); >+ } else { >+ urlTags.push(IMPORT_WITHOUT_READER); >+ } >+ } else if (isCoreTag(ns, ln, PARAM)) { >+ urlTags.push(PARAM); >+ } else if (isCoreTag(ns, ln, REDIRECT)) { >+ urlTags.push(REDIRECT); >+ } else if (isCoreTag(ns, ln, URL)) { >+ urlTags.push(URL); >+ } > >- // set up a check against illegal attribute/body combinations >- bodyIllegal = false; >- bodyNecessary = false; >- if (isCoreTag(ns, ln, EXPR)) { >- if (hasAttribute(a, DEFAULT)) >- bodyIllegal = true; >- } else if (isCoreTag(ns, ln, SET)) { >- if (hasAttribute(a, VALUE)) >- bodyIllegal = true; >- // else >- // bodyNecessary = true; >- } >+ // set up a check against illegal attribute/body combinations >+ bodyIllegal = false; >+ bodyNecessary = false; >+ if (isCoreTag(ns, ln, EXPR)) { >+ if (hasAttribute(a, DEFAULT)) { >+ bodyIllegal = true; >+ } >+ } else if (isCoreTag(ns, ln, SET)) { >+ if (hasAttribute(a, VALUE)) { >+ bodyIllegal = true; >+ } >+ // else >+ // bodyNecessary = true; >+ } > >- // record the most recent tag (for error reporting) >- lastElementName = qn; >- lastElementId = a.getValue(JSP, "id"); >+ // record the most recent tag (for error reporting) >+ lastElementName = qn; >+ lastElementId = a.getValue(JSP, "id"); > >- // we're a new element, so increase depth >- depth++; >- } >+ // we're a new element, so increase depth >+ depth++; >+ } > >- @Override >- public void characters(char[] ch, int start, int length) { >+ @Override >+ public void characters(char[] ch, int start, int length) { > >- bodyNecessary = false; // body is no longer necessary! >+ bodyNecessary = false; // body is no longer necessary! > >- // ignore strings that are just whitespace >- String s = new String(ch, start, length).trim(); >- if (s.equals("")) >- return; >+ // ignore strings that are just whitespace >+ String s = new String(ch, start, length).trim(); >+ if (s.equals("")) { >+ return; >+ } > >- // check and update body-related constraints >- if (bodyIllegal) >- fail(Resources.getMessage("TLV_ILLEGAL_BODY", lastElementName)); >- if (!urlTags.empty() >- && urlTags.peek().equals(IMPORT_WITHOUT_READER)) { >- // we're in an <import> without a Reader; nothing but >- // <param> is allowed >- fail(Resources.getMessage("TLV_ILLEGAL_BODY", >- prefix + ":" + IMPORT)); >- } >+ // check and update body-related constraints >+ if (bodyIllegal) { >+ fail(Resources.getMessage("TLV_ILLEGAL_BODY", lastElementName)); >+ } >+ if (!urlTags.empty() >+ && urlTags.peek().equals(IMPORT_WITHOUT_READER)) { >+ // we're in an <import> without a Reader; nothing but >+ // <param> is allowed >+ fail(Resources.getMessage("TLV_ILLEGAL_BODY", >+ prefix + ":" + IMPORT)); >+ } > >- // make sure <choose> has no non-whitespace text >- if (chooseChild()) { >- String msg = >- Resources.getMessage("TLV_ILLEGAL_TEXT_BODY", >- prefix, CHOOSE, >- (s.length() < 7 ? s : s.substring(0,7))); >- fail(msg); >- } >- } >+ // make sure <choose> has no non-whitespace text >+ if (chooseChild()) { >+ String msg = >+ Resources.getMessage("TLV_ILLEGAL_TEXT_BODY", >+ prefix, CHOOSE, >+ (s.length() < 7 ? s : s.substring(0, 7))); >+ fail(msg); >+ } >+ } > >- @Override >- public void endElement(String ns, String ln, String qn) { >+ @Override >+ public void endElement(String ns, String ln, String qn) { > >- // consistently, we ignore JSP_TEXT >- if (isJspTag(ns, ln, TEXT)) >- return; >+ // consistently, we ignore JSP_TEXT >+ if (isJspTag(ns, ln, TEXT)) { >+ return; >+ } > >- // handle body-related invariant >- if (bodyNecessary) >- fail(Resources.getMessage("TLV_MISSING_BODY", >- lastElementName)); >- bodyIllegal = false; // reset: we've left the tag >+ // handle body-related invariant >+ if (bodyNecessary) { >+ fail(Resources.getMessage("TLV_MISSING_BODY", >+ lastElementName)); >+ } >+ bodyIllegal = false; // reset: we've left the tag > >- // update <choose>-related state >- if (isCoreTag(ns, ln, CHOOSE)) { >- Boolean b = (Boolean) chooseHasWhen.pop(); >- if (!b.booleanValue()) >- fail(Resources.getMessage("TLV_PARENT_WITHOUT_SUBTAG", >- CHOOSE, WHEN)); >- chooseDepths.pop(); >- chooseHasOtherwise.pop(); >- } >+ // update <choose>-related state >+ if (isCoreTag(ns, ln, CHOOSE)) { >+ Boolean b = (Boolean) chooseHasWhen.pop(); >+ if (!b.booleanValue()) { >+ fail(Resources.getMessage("TLV_PARENT_WITHOUT_SUBTAG", >+ CHOOSE, WHEN)); >+ } >+ chooseDepths.pop(); >+ chooseHasOtherwise.pop(); >+ } > >- // update state related to URL tags >- if (isCoreTag(ns, ln, IMPORT) >+ // update state related to URL tags >+ if (isCoreTag(ns, ln, IMPORT) > || isCoreTag(ns, ln, PARAM) >- || isCoreTag(ns, ln, REDIRECT) >- || isCoreTag(ns, ln, URL)) >- urlTags.pop(); >+ || isCoreTag(ns, ln, REDIRECT) >+ || isCoreTag(ns, ln, URL)) { >+ urlTags.pop(); >+ } > >- // update our depth >- depth--; >- } >+ // update our depth >+ depth--; >+ } > >- // are we directly under a <choose>? >- private boolean chooseChild() { >- return (!chooseDepths.empty() >- && (depth - 1) == ((Integer) chooseDepths.peek()).intValue()); >- } >+ // are we directly under a <choose>? > >+ private boolean chooseChild() { >+ return (!chooseDepths.empty() >+ && (depth - 1) == ((Integer) chooseDepths.peek()).intValue()); >+ } >+ > } > } >Index: src/main/java/org/apache/taglibs/standard/tlv/JstlBaseTLV.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tlv/JstlBaseTLV.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tlv/JstlBaseTLV.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tlv; > >@@ -41,7 +41,7 @@ > > /** > * <p>A base class to support SAX-based validation in JSTL.</p> >- * >+ * > * @author Shawn Bayern > */ > public abstract class JstlBaseTLV extends TagLibraryValidator { >@@ -66,19 +66,19 @@ > > // attributes > protected static final String VAR = "var"; >- protected static final String SCOPE = "scope"; >+ protected static final String SCOPE = "scope"; > > //scopes >- protected static final String PAGE_SCOPE = "page"; >- protected static final String REQUEST_SCOPE = "request"; >- protected static final String SESSION_SCOPE = "session"; >+ protected static final String PAGE_SCOPE = "page"; >+ protected static final String REQUEST_SCOPE = "request"; >+ protected static final String SESSION_SCOPE = "session"; > protected static final String APPLICATION_SCOPE = "application"; > > // Relevant URIs >- protected final String JSP = "http://java.sun.com/JSP/Page"; >- >+ protected final String JSP = "http://java.sun.com/JSP/Page"; >+ > // types of sub-classes - used on method validate() >- private static final int TYPE_UNDEFINED = 0; >+ private static final int TYPE_UNDEFINED = 0; > protected static final int TYPE_CORE = 1; > protected static final int TYPE_FMT = 2; > protected static final int TYPE_SQL = 3; >@@ -90,82 +90,84 @@ > //********************************************************************* > // Validation and configuration state (protected) > >- protected String uri; // our taglib's uri (as passed by JSP container on XML View) >- protected String prefix; // our taglib's prefix >- protected Vector messageVector; // temporary error messages >- protected Map config; // configuration (Map of Sets) >- protected boolean failed; // have we failed >0 times? >- protected String lastElementId; // the last element we've seen >+ protected String uri; // our taglib's uri (as passed by JSP container on XML View) >+ protected String prefix; // our taglib's prefix >+ protected Vector messageVector; // temporary error messages >+ protected Map config; // configuration (Map of Sets) >+ protected boolean failed; // have we failed >0 times? >+ protected String lastElementId; // the last element we've seen > > //********************************************************************* > // Constructor and lifecycle management > > public JstlBaseTLV() { >- super(); >- init(); >+ super(); >+ init(); > } > > private void init() { >- messageVector = null; >- prefix = null; >- config = null; >+ messageVector = null; >+ prefix = null; >+ config = null; > } > > @Override > public void release() { >- super.release(); >- init(); >+ super.release(); >+ init(); > } >- > >+ > //********************************************************************* > // Validation entry point - this method is called by the sub-classes to > // do the validation. > > public synchronized ValidationMessage[] validate( >- int type, String prefix, String uri, PageData page) { >- try { >- this.tlvType = type; >- this.uri = uri; >- // initialize >- messageVector = new Vector(); >+ int type, String prefix, String uri, PageData page) { >+ try { >+ this.tlvType = type; >+ this.uri = uri; >+ // initialize >+ messageVector = new Vector(); > >- // save the prefix >- this.prefix = prefix; >+ // save the prefix >+ this.prefix = prefix; > >- // parse parameters if necessary >- try { >- if (config == null) >- configure((String) getInitParameters().get(EXP_ATT_PARAM)); >- } catch (NoSuchElementException ex) { >- // parsing error >- return vmFromString( >- Resources.getMessage("TLV_PARAMETER_ERROR", >- EXP_ATT_PARAM)); >- } >+ // parse parameters if necessary >+ try { >+ if (config == null) { >+ configure((String) getInitParameters().get(EXP_ATT_PARAM)); >+ } >+ } catch (NoSuchElementException ex) { >+ // parsing error >+ return vmFromString( >+ Resources.getMessage("TLV_PARAMETER_ERROR", >+ EXP_ATT_PARAM)); >+ } > >- // get a handler >- DefaultHandler h = getHandler(); >+ // get a handler >+ DefaultHandler h = getHandler(); > >- // parse the page >- SAXParserFactory f = SAXParserFactory.newInstance(); >- f.setValidating(false); >- f.setNamespaceAware(true); >- SAXParser p = f.newSAXParser(); >- p.parse(page.getInputStream(), h); >+ // parse the page >+ SAXParserFactory f = SAXParserFactory.newInstance(); >+ f.setValidating(false); >+ f.setNamespaceAware(true); >+ SAXParser p = f.newSAXParser(); >+ p.parse(page.getInputStream(), h); > >- if (messageVector.size() == 0) >- return null; >- else >- return vmFromVector(messageVector); >+ if (messageVector.size() == 0) { >+ return null; >+ } else { >+ return vmFromVector(messageVector); >+ } > >- } catch (SAXException ex) { >- return vmFromString(ex.toString()); >- } catch (ParserConfigurationException ex) { >- return vmFromString(ex.toString()); >- } catch (IOException ex) { >- return vmFromString(ex.toString()); >- } >+ } catch (SAXException ex) { >+ return vmFromString(ex.toString()); >+ } catch (ParserConfigurationException ex) { >+ return vmFromString(ex.toString()); >+ } catch (IOException ex) { >+ return vmFromString(ex.toString()); >+ } > } > > //********************************************************************* >@@ -173,24 +175,27 @@ > > // delegate validation to the appropriate expression language > // TODO refactor this into EL tag specific functionality >+ > @Deprecated > protected String validateExpression( >- String elem, String att, String expr) { >+ String elem, String att, String expr) { > > return null; > } > > // utility methods to help us match elements in our tagset >+ > protected boolean isTag(String tagUri, >- String tagLn, >- String matchUri, >- String matchLn) { >- if (tagUri == null >+ String tagLn, >+ String matchUri, >+ String matchLn) { >+ if (tagUri == null > || tagUri.length() == 0 >- || tagLn == null >- || matchUri == null >- || matchLn == null) >- return false; >+ || tagLn == null >+ || matchUri == null >+ || matchLn == null) { >+ return false; >+ } > // match beginning of URI since some suffix *_rt tags can > // be nested in EL enabled tags as defined by the spec > if (tagUri.length() > matchUri.length()) { >@@ -204,27 +209,28 @@ > return isTag(tagUri, tagLn, JSP, target); > } > >- private boolean isTag( int type, String tagUri, String tagLn, String target) { >- return ( this.tlvType == type && isTag(tagUri, tagLn, this.uri, target) ); >+ private boolean isTag(int type, String tagUri, String tagLn, String target) { >+ return (this.tlvType == type && isTag(tagUri, tagLn, this.uri, target)); > } > > protected boolean isCoreTag(String tagUri, String tagLn, String target) { >- return isTag( TYPE_CORE, tagUri, tagLn, target ); >+ return isTag(TYPE_CORE, tagUri, tagLn, target); > } > > protected boolean isFmtTag(String tagUri, String tagLn, String target) { >- return isTag( TYPE_FMT, tagUri, tagLn, target ); >+ return isTag(TYPE_FMT, tagUri, tagLn, target); > } > > protected boolean isSqlTag(String tagUri, String tagLn, String target) { >- return isTag( TYPE_SQL, tagUri, tagLn, target ); >+ return isTag(TYPE_SQL, tagUri, tagLn, target); > } > > protected boolean isXmlTag(String tagUri, String tagLn, String target) { >- return isTag( TYPE_XML, tagUri, tagLn, target ); >+ return isTag(TYPE_XML, tagUri, tagLn, target); > } > > // utility method to determine if an attribute exists >+ > protected boolean hasAttribute(Attributes a, String att) { > return (a.getValue(att) != null); > } >@@ -233,91 +239,105 @@ > * method to assist with failure [ as if it's not easy enough > * already :-) ] > */ >+ > protected void fail(String message) { > failed = true; > messageVector.add(new ValidationMessage(lastElementId, message)); > } > > // returns true if the given attribute name is specified, false otherwise >+ > protected boolean isSpecified(TagData data, String attributeName) { > return (data.getAttribute(attributeName) != null); > } > > // returns true if the 'scope' attribute is valid >+ > protected boolean hasNoInvalidScope(Attributes a) { > String scope = a.getValue(SCOPE); > >- if ((scope != null) >- && !scope.equals(PAGE_SCOPE) >- && !scope.equals(REQUEST_SCOPE) >- && !scope.equals(SESSION_SCOPE) >- && !scope.equals(APPLICATION_SCOPE)) >- return false; >+ if ((scope != null) >+ && !scope.equals(PAGE_SCOPE) >+ && !scope.equals(REQUEST_SCOPE) >+ && !scope.equals(SESSION_SCOPE) >+ && !scope.equals(APPLICATION_SCOPE)) { >+ return false; >+ } > > return true; > } > > // returns true if the 'var' attribute is empty >+ > protected boolean hasEmptyVar(Attributes a) { >- if ("".equals(a.getValue(VAR))) >- return true; >- return false; >+ if ("".equals(a.getValue(VAR))) { >+ return true; >+ } >+ return false; > } > > // returns true if the 'scope' attribute is present without 'var' >+ > protected boolean hasDanglingScope(Attributes a) { >- return (a.getValue(SCOPE) != null && a.getValue(VAR) == null); >+ return (a.getValue(SCOPE) != null && a.getValue(VAR) == null); > } > > // retrieves the local part of a QName >+ > protected String getLocalPart(String qname) { >- int colon = qname.indexOf(":"); >- if (colon == -1) >- return qname; >- else >- return qname.substring(colon + 1); >+ int colon = qname.indexOf(":"); >+ if (colon == -1) { >+ return qname; >+ } else { >+ return qname.substring(colon + 1); >+ } > } > > //********************************************************************* > // Miscellaneous utility functions > > // parses our configuration parameter for element:attribute pairs >+ > private void configure(String info) { > // construct our configuration map >- config = new HashMap(); >+ config = new HashMap(); > >- // leave the map empty if we have nothing to configure >- if (info == null) >- return; >+ // leave the map empty if we have nothing to configure >+ if (info == null) { >+ return; >+ } > >- // separate parameter into space-separated tokens and store them >- StringTokenizer st = new StringTokenizer(info); >- while (st.hasMoreTokens()) { >- String pair = st.nextToken(); >- StringTokenizer pairTokens = new StringTokenizer(pair, ":"); >- String element = pairTokens.nextToken(); >- String attribute = pairTokens.nextToken(); >- Object atts = config.get(element); >- if (atts == null) { >- atts = new HashSet(); >- config.put(element, atts); >- } >- ((Set) atts).add(attribute); >- } >+ // separate parameter into space-separated tokens and store them >+ StringTokenizer st = new StringTokenizer(info); >+ while (st.hasMoreTokens()) { >+ String pair = st.nextToken(); >+ StringTokenizer pairTokens = new StringTokenizer(pair, ":"); >+ String element = pairTokens.nextToken(); >+ String attribute = pairTokens.nextToken(); >+ Object atts = config.get(element); >+ if (atts == null) { >+ atts = new HashSet(); >+ config.put(element, atts); >+ } >+ ((Set) atts).add(attribute); >+ } > } > > // constructs a ValidationMessage[] from a single String and no ID >+ > static ValidationMessage[] vmFromString(String message) { >- return new ValidationMessage[] { >- new ValidationMessage(null, message) >- }; >+ return new ValidationMessage[]{ >+ new ValidationMessage(null, message) >+ }; > } > > // constructs a ValidationMessage[] from a ValidationMessage Vector >+ > static ValidationMessage[] vmFromVector(Vector v) { >- ValidationMessage[] vm = new ValidationMessage[v.size()]; >- for (int i = 0; i < vm.length; i++) >- vm[i] = (ValidationMessage) v.get(i); >- return vm; >+ ValidationMessage[] vm = new ValidationMessage[v.size()]; >+ for (int i = 0; i < vm.length; i++) { >+ vm[i] = (ValidationMessage) v.get(i); >+ } >+ return vm; > } > } >Index: src/main/java/org/apache/taglibs/standard/functions/Functions.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/functions/Functions.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/functions/Functions.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.functions; > >@@ -32,12 +32,12 @@ > /** > * Static functions that extend the Expression Language with standardized behaviour > * commonly used by page authors. >- * >+ * <p/> > * <strong>Implementation Note:</strong> When passing a String parameter, section > * 1.18.2 of the EL specification requires the container to coerce a null value to an > * empty string. These implementation assume such behaviour and do not check for null > * parameters. Passing a null will generally trigger a NullPointerException. >- * >+ * > * @author Pierre Delisle > */ > >@@ -67,18 +67,18 @@ > public static String toLowerCase(String input) { > return input.toLowerCase(); > } >- >+ > //********************************************************************* > // Substring processing > > /** > * Returns the index (0-based) withing a string of the first occurrence of a specified > * substring according to the semantics of the method <code>String#indexOf()</code>. >- * >+ * <p/> > * If <code>substring</code> is empty, this matches the beginning of the string and the > * value returned is 0. > * >- * @param input the input string on which the function is applied >+ * @param input the input string on which the function is applied > * @param substring the substring to search for in the input string > * @return the 0-based index of the first matching substring, or -1 if it does not occur > */ >@@ -89,23 +89,23 @@ > /** > * Tests if a string contains the specified substring. > * >- * @param input the input string on which the function is applied >+ * @param input the input string on which the function is applied > * @param substring the substring tested for > * @return true if the character sequence represented by the substring >- * exists in the string >+ * exists in the string > */ > public static boolean contains(String input, String substring) { > return input.contains(substring); >- } >+ } > > /** > * Tests if a string contains the specified substring in a case insensitive way. > * Equivalent to <code>fn:contains(fn:toUpperCase(string), fn:toUpperCase(substring))</code>. > * >- * @param input the input string on which the function is applied >+ * @param input the input string on which the function is applied > * @param substring the substring tested for > * @return true if the character sequence represented by the substring >- * exists in the string >+ * exists in the string > */ > public static boolean containsIgnoreCase(String input, String substring) { > return contains(input.toUpperCase(), substring.toUpperCase()); >@@ -115,19 +115,19 @@ > * Tests if a string starts with the specified prefix according to the semantics > * of <code>String#startsWith()</code>. > * >- * @param input the input string on which the function is applied >+ * @param input the input string on which the function is applied > * @param prefix the prefix to be matched > * @return true if the input string starts with the prefix > */ > public static boolean startsWith(String input, String prefix) { > return input.startsWith(prefix); >- } >- >+ } >+ > /** > * Tests if a string ends with the specified suffix according to the semantics > * of <code>String#endsWith()</code>. > * >- * @param input the input string on which the function is applied >+ * @param input the input string on which the function is applied > * @param suffix the suffix to be matched > * @return true if the input string ends with the suffix > */ >@@ -145,27 +145,33 @@ > * <li>if <code>endIndex < beginIndex</code>, an empty string is returned</li> > * </ul> > * >- * @param input the input string on which the substring function is applied >+ * @param input the input string on which the substring function is applied > * @param beginIndex the beginning index (0-based), inclusive >- * @param endIndex the end index (0-based), exclusive >+ * @param endIndex the end index (0-based), exclusive > * @return a subset of string > */ > public static String substring(String input, int beginIndex, int endIndex) { >- if (beginIndex < 0) beginIndex = 0; >- if (endIndex < 0 || endIndex > input.length()) endIndex = input.length(); >- if (endIndex < beginIndex) return ""; >+ if (beginIndex < 0) { >+ beginIndex = 0; >+ } >+ if (endIndex < 0 || endIndex > input.length()) { >+ endIndex = input.length(); >+ } >+ if (endIndex < beginIndex) { >+ return ""; >+ } > return input.substring(beginIndex, endIndex); > } > > /** > * Returns a subset of a string following the first occurrence of a specific substring. >- * >+ * <p/> > * If the substring is empty, it matches the beginning of the input string and the > * entire input string is returned. If the substring does not occur, an empty string is returned. > * >- * @param input the input string on which the substring function is applied >+ * @param input the input string on which the substring function is applied > * @param substring the substring that delimits the beginning of the subset >- * of the input string to be returned >+ * of the input string to be returned > * @return a substring of the input string that starts at the first character after the specified substring > */ > public static String substringAfter(String input, String substring) { >@@ -173,19 +179,19 @@ > if (index == -1) { > return ""; > } else { >- return input.substring(index+substring.length()); >+ return input.substring(index + substring.length()); > } >- } >- >+ } >+ > /** > * Returns a subset of a string immediately before the first occurrence of a specific substring. >- * >+ * <p/> > * If the substring is empty, it matches the beginning of the input string and an empty string is returned. > * If the substring does not occur, an empty string is returned. > * >- * @param input the input string on which the substring function is applied >+ * @param input the input string on which the substring function is applied > * @param substring the substring that delimits the beginning of the subset >- * of the input string to be returned >+ * of the input string to be returned > * @return a substring of the input string that starts at the first character after the specified substring > */ > public static String substringBefore(String input, String substring) { >@@ -195,7 +201,7 @@ > } else { > return input.substring(0, index); > } >- } >+ } > > //********************************************************************* > // Character replacement >@@ -224,13 +230,12 @@ > * Returns a string resulting from replacing all occurrences of a "before" substring with an "after" substring. > * The string is processed once and not reprocessed for further replacements. > * >- * @param input the string on which the replacement is to be applied >+ * @param input the string on which the replacement is to be applied > * @param before the substring to replace >- * @param after the replacement substring >+ * @param after the replacement substring > * @return a string with before replaced with after > */ >- public static String replace(String input, String before, String after) >- { >+ public static String replace(String input, String before, String after) { > if (before.length() == 0) { > return input; > } >@@ -242,14 +247,13 @@ > * If the input string is empty, a single element array containing an empty string is returned. > * If the delimiters are empty, a single element array containing the input string is returned. > * >- * @param input the string to split >+ * @param input the string to split > * @param delimiters characters used to split the string > * @return an array of strings > */ >- public static String[] split(String input, String delimiters) >- { >+ public static String[] split(String input, String delimiters) { > if (input.length() == 0 || delimiters.length() == 0) { >- return new String[] { input }; >+ return new String[]{input}; > } > > StringTokenizer tok = new StringTokenizer(input, delimiters); >@@ -263,12 +267,12 @@ > > /** > * Joins all elements of an array into a string. >- * >+ * <p/> > * <strong>Implementation Note</strong>: The specification does not define what happens when > * elements in the array are null. For compatibility with previous implementations, the string > * "null" is used although EL conventions would suggest an empty string might be better. > * >- * @param array an array of strings to be joined >+ * @param array an array of strings to be joined > * @param separator used to separate the joined strings > * @return all array elements joined into one string with the specified separator > */ >@@ -304,7 +308,7 @@ > if (obj == null) { > return 0; > } >- >+ > if (obj instanceof String) { > return ((String) obj).length(); > } >@@ -316,15 +320,15 @@ > } > if (obj instanceof Iterator) { > int count = 0; >- Iterator iter = (Iterator)obj; >+ Iterator iter = (Iterator) obj; > while (iter.hasNext()) { > count++; > iter.next(); > } > return count; >- } >+ } > if (obj instanceof Enumeration) { >- Enumeration enum_ = (Enumeration)obj; >+ Enumeration enum_ = (Enumeration) obj; > int count = 0; > while (enum_.hasMoreElements()) { > count++; >@@ -336,5 +340,5 @@ > return Array.getLength(obj); > } > throw new JspTagException(Resources.getMessage("PARAM_BAD_VALUE")); >- } >+ } > } >Index: src/main/java/org/apache/taglibs/standard/tag/rt/sql/QueryTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/rt/sql/QueryTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/rt/sql/QueryTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > package org.apache.taglibs.standard.tag.rt.sql; > > import org.apache.taglibs.standard.tag.common.sql.QueryTagSupport; >@@ -40,10 +40,10 @@ > > //********************************************************************* > // Accessor methods >- >+ > public void setDataSource(Object dataSource) { >- this.rawDataSource = dataSource; >- this.dataSourceSpecified = true; >+ this.rawDataSource = dataSource; >+ this.dataSourceSpecified = true; > } > > /** >@@ -60,7 +60,7 @@ > */ > public void setMaxRows(int maxRows) { > this.maxRows = maxRows; >- this.maxRowsSpecified = true; >+ this.maxRowsSpecified = true; > } > > /** >@@ -70,7 +70,7 @@ > * be set using nested value elements. > */ > public void setSql(String sql) { >- this.sql = sql; >+ this.sql = sql; > } > > } >Index: src/main/java/org/apache/taglibs/standard/tag/rt/sql/TransactionTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/rt/sql/TransactionTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/rt/sql/TransactionTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > package org.apache.taglibs.standard.tag.rt.sql; > > import javax.servlet.jsp.JspException; >@@ -27,7 +27,7 @@ > */ > public class TransactionTag extends TransactionTagSupport { > private String isolationRT; >- >+ > //********************************************************************* > // Accessor methods > >@@ -37,8 +37,8 @@ > * a String or a DataSource object. > */ > public void setDataSource(Object dataSource) { >- this.rawDataSource = dataSource; >- this.dataSourceSpecified = true; >+ this.rawDataSource = dataSource; >+ this.dataSourceSpecified = true; > } > > /** >@@ -46,13 +46,14 @@ > */ > @Override > public void setIsolation(String isolation) { >- this.isolationRT = isolation; >+ this.isolationRT = isolation; > } > > @Override > public int doStartTag() throws JspException { >- if (isolationRT != null) >- super.setIsolation(isolationRT); >+ if (isolationRT != null) { >+ super.setIsolation(isolationRT); >+ } > return super.doStartTag(); > } > } >Index: src/main/java/org/apache/taglibs/standard/tag/rt/sql/SetDataSourceTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/rt/sql/SetDataSourceTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/rt/sql/SetDataSourceTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.rt.sql; > >@@ -22,7 +22,6 @@ > /** > * <p>Tag handler for <Driver> in JSTL, used to create > * a simple DataSource for prototyping.</p> >- * > */ > public class SetDataSourceTag extends SetDataSourceTagSupport { > >@@ -30,24 +29,24 @@ > // Accessor methods > > public void setDataSource(Object dataSource) { >- this.dataSource = dataSource; >- this.dataSourceSpecified = true; >+ this.dataSource = dataSource; >+ this.dataSourceSpecified = true; > } > > public void setDriver(String driverClassName) { >- this.driverClassName = driverClassName; >+ this.driverClassName = driverClassName; > } > > public void setUrl(String jdbcURL) { >- this.jdbcURL = jdbcURL; >+ this.jdbcURL = jdbcURL; > } > > public void setUser(String userName) { >- this.userName = userName; >+ this.userName = userName; > } > > public void setPassword(String password) { >- this.password = password; >+ this.password = password; > } > > } >Index: src/main/java/org/apache/taglibs/standard/tag/rt/sql/DateParamTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/rt/sql/DateParamTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/rt/sql/DateParamTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > package org.apache.taglibs.standard.tag.rt.sql; > > import java.util.Date; >@@ -26,12 +26,12 @@ > * @author Justyna Horwat > */ > public class DateParamTag extends DateParamTagSupport { >- >+ > public void setValue(Date value) { >- this.value = value; >+ this.value = value; > } > > public void setType(String type) { >- this.type = type; >+ this.type = type; > } > } >Index: src/main/java/org/apache/taglibs/standard/tag/rt/sql/ParamTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/rt/sql/ParamTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/rt/sql/ParamTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > package org.apache.taglibs.standard.tag.rt.sql; > > import org.apache.taglibs.standard.tag.common.sql.ParamTagSupport; >@@ -24,8 +24,8 @@ > * @author Hans Bergsten > */ > public class ParamTag extends ParamTagSupport { >- >+ > public void setValue(Object value) { >- this.value = value; >+ this.value = value; > } > } >Index: src/main/java/org/apache/taglibs/standard/tag/rt/sql/UpdateTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/rt/sql/UpdateTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/rt/sql/UpdateTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > package org.apache.taglibs.standard.tag.rt.sql; > > import org.apache.taglibs.standard.tag.common.sql.UpdateTagSupport; >@@ -28,14 +28,14 @@ > //********************************************************************* > // Accessor methods > >- >+ > /** > * Setter method for the SQL DataSource. DataSource can be > * a String or a DataSource object. > */ > public void setDataSource(Object dataSource) { >- this.rawDataSource = dataSource; >- this.dataSourceSpecified = true; >+ this.rawDataSource = dataSource; >+ this.dataSourceSpecified = true; > } > > /** >@@ -45,6 +45,6 @@ > * be set using nested value elements. > */ > public void setSql(String sql) { >- this.sql = sql; >+ this.sql = sql; > } > } >Index: src/main/java/org/apache/taglibs/standard/tag/rt/xml/ParseTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/rt/xml/ParseTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/rt/xml/ParseTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.rt.xml; > >@@ -36,22 +36,25 @@ > > // Deprecated as of JSTL 1.1 > // for tag attribute >+ > public void setXml(Object xml) throws JspTagException { > this.xml = xml; > } > > // 'doc' replaces 'xml' as of JSTL 1.1 >+ > public void setDoc(Object xml) throws JspTagException { > this.xml = xml; > } > > public void setSystemId(String systemId) throws JspTagException { >- this.systemId = systemId; >+ this.systemId = systemId; > } > > // for tag attribute >+ > public void setFilter(XMLFilter filter) throws JspTagException { >- this.filter = filter; >+ this.filter = filter; > } > > } >Index: src/main/java/org/apache/taglibs/standard/tag/rt/xml/TransformTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/rt/xml/TransformTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/rt/xml/TransformTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.rt.xml; > >@@ -36,11 +36,13 @@ > > // Deprecated as of JSTL 1.1 > // for tag attribute >+ > public void setXml(Object xml) throws JspTagException { > setDoc(xml); > } > > // 'doc' replaces 'xml' as of JSTL 1.1 >+ > public void setDoc(Object xml) throws JspTagException { > this.xml = xml; > this.xmlSpecified = true; >@@ -48,26 +50,31 @@ > > // Deprecated as of JSTL 1.1 > // for tag attribute >+ > public void setXmlSystemId(String xmlSystemId) throws JspTagException { > this.xmlSystemId = xmlSystemId; > } > > // 'docSystemId' replaces 'xmlSystemId' as of JSTL 1.1 >+ > public void setDocSystemId(String xmlSystemId) throws JspTagException { > this.xmlSystemId = xmlSystemId; > } > > // for tag attribute >+ > public void setXslt(Object xslt) throws JspTagException { > this.xslt = xslt; > } > > // for tag attribute >+ > public void setXsltSystemId(String xsltSystemId) throws JspTagException { > this.xsltSystemId = xsltSystemId; > } > > // for tag attribute >+ > public void setResult(Result result) throws JspTagException { > this.result = result; > } >Index: src/main/java/org/apache/taglibs/standard/tag/rt/xml/ExprTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/rt/xml/ExprTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/rt/xml/ExprTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.rt.xml; > >@@ -32,8 +32,9 @@ > // Accessor methods > > // for tag attribute >+ > public void setEscapeXml(boolean escapeXml) { >- this.escapeXml = escapeXml; >+ this.escapeXml = escapeXml; > } > > } >Index: src/main/java/org/apache/taglibs/standard/tag/rt/xml/ParamTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/rt/xml/ParamTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/rt/xml/ParamTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.rt.xml; > >@@ -34,11 +34,13 @@ > // Accessor methods > > // for tag attribute >+ > public void setName(String name) throws JspTagException { > this.name = name; > } > > // for tag attribute >+ > public void setValue(Object value) throws JspTagException { > this.value = value; > } >Index: src/main/java/org/apache/taglibs/standard/tag/rt/fmt/ParseNumberTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/rt/fmt/ParseNumberTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/rt/fmt/ParseNumberTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.rt.fmt; > >@@ -37,38 +37,43 @@ > // Accessor methods > > // 'value' attribute >+ > public void setValue(String value) throws JspTagException { > this.value = value; >- this.valueSpecified = true; >+ this.valueSpecified = true; > } > > // 'type' attribute >+ > public void setType(String type) throws JspTagException { > this.type = type; > } > > // 'pattern' attribute >+ > public void setPattern(String pattern) throws JspTagException { > this.pattern = pattern; > } > > // 'parseLocale' attribute >+ > public void setParseLocale(Object loc) throws JspTagException { >- if (loc != null) { >- if (loc instanceof Locale) { >- this.parseLocale = (Locale) loc; >- } else { >- if (!"".equals((String) loc)) { >- this.parseLocale = SetLocaleSupport.parseLocale((String) >- loc); >- } >- } >- } >+ if (loc != null) { >+ if (loc instanceof Locale) { >+ this.parseLocale = (Locale) loc; >+ } else { >+ if (!"".equals((String) loc)) { >+ this.parseLocale = SetLocaleSupport.parseLocale((String) >+ loc); >+ } >+ } >+ } > } > > // 'integerOnly' attribute >+ > public void setIntegerOnly(boolean isIntegerOnly) throws JspTagException { > this.isIntegerOnly = isIntegerOnly; >- this.integerOnlySpecified = true; >+ this.integerOnlySpecified = true; > } > } >Index: src/main/java/org/apache/taglibs/standard/tag/rt/fmt/MessageTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/rt/fmt/MessageTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/rt/fmt/MessageTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.rt.fmt; > >@@ -35,12 +35,14 @@ > // Accessor methods > > // for tag attribute >+ > public void setKey(String key) throws JspTagException { > this.keyAttrValue = key; >- this.keySpecified = true; >+ this.keySpecified = true; > } > > // for tag attribute >+ > public void setBundle(LocalizationContext locCtxt) throws JspTagException { > this.bundleAttrValue = locCtxt; > this.bundleSpecified = true; >Index: src/main/java/org/apache/taglibs/standard/tag/rt/fmt/SetBundleTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/rt/fmt/SetBundleTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/rt/fmt/SetBundleTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.rt.fmt; > >@@ -34,6 +34,7 @@ > // Accessor methods > > // for tag attribute >+ > public void setBasename(String basename) throws JspTagException { > this.basename = basename; > } >Index: src/main/java/org/apache/taglibs/standard/tag/rt/fmt/FormatDateTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/rt/fmt/FormatDateTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/rt/fmt/FormatDateTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.rt.fmt; > >@@ -36,31 +36,37 @@ > // Accessor methods > > // 'value' attribute >+ > public void setValue(Date value) throws JspTagException { > this.value = value; > } > > // 'type' attribute >+ > public void setType(String type) throws JspTagException { > this.type = type; > } > > // 'dateStyle' attribute >+ > public void setDateStyle(String dateStyle) throws JspTagException { > this.dateStyle = dateStyle; > } > > // 'timeStyle' attribute >+ > public void setTimeStyle(String timeStyle) throws JspTagException { > this.timeStyle = timeStyle; > } > > // 'pattern' attribute >+ > public void setPattern(String pattern) throws JspTagException { > this.pattern = pattern; > } > > // 'timeZone' attribute >+ > public void setTimeZone(Object timeZone) throws JspTagException { > this.timeZone = timeZone; > } >Index: src/main/java/org/apache/taglibs/standard/tag/rt/fmt/SetTimeZoneTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/rt/fmt/SetTimeZoneTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/rt/fmt/SetTimeZoneTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.rt.fmt; > >@@ -34,6 +34,7 @@ > // Accessor methods > > // for tag attribute >+ > public void setValue(Object value) throws JspTagException { > this.value = value; > } >Index: src/main/java/org/apache/taglibs/standard/tag/rt/fmt/ParseDateTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/rt/fmt/ParseDateTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/rt/fmt/ParseDateTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.rt.fmt; > >@@ -37,47 +37,54 @@ > // Accessor methods > > // 'value' attribute >+ > public void setValue(String value) throws JspTagException { > this.value = value; >- this.valueSpecified = true; >+ this.valueSpecified = true; > } > > // 'type' attribute >+ > public void setType(String type) throws JspTagException { > this.type = type; > } > > // 'dateStyle' attribute >+ > public void setDateStyle(String dateStyle) throws JspTagException { > this.dateStyle = dateStyle; > } > > // 'timeStyle' attribute >+ > public void setTimeStyle(String timeStyle) throws JspTagException { > this.timeStyle = timeStyle; > } > > // 'pattern' attribute >+ > public void setPattern(String pattern) throws JspTagException { > this.pattern = pattern; > } > > // 'timeZone' attribute >+ > public void setTimeZone(Object timeZone) throws JspTagException { > this.timeZone = timeZone; > } > > // 'parseLocale' attribute >+ > public void setParseLocale(Object loc) throws JspTagException { >- if (loc != null) { >- if (loc instanceof Locale) { >- this.parseLocale = (Locale) loc; >- } else { >- if (!"".equals((String) loc)) { >- this.parseLocale = SetLocaleSupport.parseLocale((String) >- loc); >- } >- } >- } >+ if (loc != null) { >+ if (loc instanceof Locale) { >+ this.parseLocale = (Locale) loc; >+ } else { >+ if (!"".equals((String) loc)) { >+ this.parseLocale = SetLocaleSupport.parseLocale((String) >+ loc); >+ } >+ } >+ } > } > } >Index: src/main/java/org/apache/taglibs/standard/tag/rt/fmt/BundleTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/rt/fmt/BundleTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/rt/fmt/BundleTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.rt.fmt; > >@@ -34,11 +34,13 @@ > // Accessor methods > > // for tag attribute >+ > public void setBasename(String basename) throws JspTagException { > this.basename = basename; > } > > // for tag attribute >+ > public void setPrefix(String prefix) throws JspTagException { > this.prefix = prefix; > } >Index: src/main/java/org/apache/taglibs/standard/tag/rt/fmt/TimeZoneTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/rt/fmt/TimeZoneTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/rt/fmt/TimeZoneTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.rt.fmt; > >@@ -34,6 +34,7 @@ > // Accessor methods > > // for tag attribute >+ > public void setValue(Object value) throws JspTagException { > this.value = value; > } >Index: src/main/java/org/apache/taglibs/standard/tag/rt/fmt/SetLocaleTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/rt/fmt/SetLocaleTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/rt/fmt/SetLocaleTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.rt.fmt; > >@@ -34,11 +34,13 @@ > // Accessor methods > > // for tag attribute >+ > public void setValue(Object value) throws JspTagException { > this.value = value; > } > > // for tag attribute >+ > public void setVariant(String variant) throws JspTagException { > this.variant = variant; > } >Index: src/main/java/org/apache/taglibs/standard/tag/rt/fmt/RequestEncodingTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/rt/fmt/RequestEncodingTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/rt/fmt/RequestEncodingTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.rt.fmt; > >@@ -34,6 +34,7 @@ > // Accessor methods > > // for tag attribute >+ > public void setValue(String value) throws JspTagException { > this.value = value; > } >Index: src/main/java/org/apache/taglibs/standard/tag/rt/fmt/ParamTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/rt/fmt/ParamTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/rt/fmt/ParamTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.rt.fmt; > >@@ -34,8 +34,9 @@ > // Accessor methods > > // for tag attribute >+ > public void setValue(Object value) throws JspTagException { > this.value = value; >- this.valueSpecified = true; >+ this.valueSpecified = true; > } > } >Index: src/main/java/org/apache/taglibs/standard/tag/rt/fmt/FormatNumberTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/rt/fmt/FormatNumberTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/rt/fmt/FormatNumberTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.rt.fmt; > >@@ -34,60 +34,70 @@ > // Accessor methods > > // 'value' attribute >+ > public void setValue(Object value) throws JspTagException { > this.value = value; >- this.valueSpecified = true; >+ this.valueSpecified = true; > } > > // 'type' attribute >+ > public void setType(String type) throws JspTagException { > this.type = type; > } > > // 'pattern' attribute >+ > public void setPattern(String pattern) throws JspTagException { > this.pattern = pattern; > } > > // 'currencyCode' attribute >+ > public void setCurrencyCode(String currencyCode) throws JspTagException { > this.currencyCode = currencyCode; > } > > // 'currencySymbol' attribute >+ > public void setCurrencySymbol(String currencySymbol) >- throws JspTagException { >+ throws JspTagException { > this.currencySymbol = currencySymbol; > } > > // 'groupingUsed' attribute >+ > public void setGroupingUsed(boolean isGroupingUsed) >- throws JspTagException { >+ throws JspTagException { > this.isGroupingUsed = isGroupingUsed; >- this.groupingUsedSpecified = true; >+ this.groupingUsedSpecified = true; > } > > // 'maxIntegerDigits' attribute >+ > public void setMaxIntegerDigits(int maxDigits) throws JspTagException { > this.maxIntegerDigits = maxDigits; >- this.maxIntegerDigitsSpecified = true; >+ this.maxIntegerDigitsSpecified = true; > } > > // 'minIntegerDigits' attribute >+ > public void setMinIntegerDigits(int minDigits) throws JspTagException { > this.minIntegerDigits = minDigits; >- this.minIntegerDigitsSpecified = true; >+ this.minIntegerDigitsSpecified = true; > } > > // 'maxFractionDigits' attribute >+ > public void setMaxFractionDigits(int maxDigits) throws JspTagException { > this.maxFractionDigits = maxDigits; >- this.maxFractionDigitsSpecified = true; >+ this.maxFractionDigitsSpecified = true; > } > > // 'minFractionDigits' attribute >+ > public void setMinFractionDigits(int minDigits) throws JspTagException { > this.minFractionDigits = minDigits; >- this.minFractionDigitsSpecified = true; >+ this.minFractionDigitsSpecified = true; > } > } >Index: src/main/java/org/apache/taglibs/standard/tag/rt/core/ForEachTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/rt/core/ForEachTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/rt/core/ForEachTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.rt.core; > >@@ -33,14 +33,14 @@ > */ > > public class ForEachTag >- extends ForEachSupport >- implements LoopTag, IterationTag >-{ >+ extends ForEachSupport >+ implements LoopTag, IterationTag { > > //********************************************************************* > // Accessor methods > > // for tag attribute >+ > public void setBegin(int begin) throws JspTagException { > this.beginSpecified = true; > this.begin = begin; >@@ -48,6 +48,7 @@ > } > > // for tag attribute >+ > public void setEnd(int end) throws JspTagException { > this.endSpecified = true; > this.end = end; >@@ -55,6 +56,7 @@ > } > > // for tag attribute >+ > public void setStep(int step) throws JspTagException { > this.stepSpecified = true; > this.step = step; >@@ -62,10 +64,11 @@ > } > > public void setItems(Object o) throws JspTagException { >- // for null items, simulate an empty list >- if (o == null) >- rawItems = new ArrayList(); >- else >- rawItems = o; >+ // for null items, simulate an empty list >+ if (o == null) { >+ rawItems = new ArrayList(); >+ } else { >+ rawItems = o; >+ } > } > } >Index: src/main/java/org/apache/taglibs/standard/tag/rt/core/OutTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/rt/core/OutTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/rt/core/OutTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.rt.core; > >@@ -43,16 +43,19 @@ > } > > // for tag attribute >+ > public void setValue(Object value) { > this.value = value; > } >- >+ > // for tag attribute >+ > public void setDefault(String def) { > this.def = def; > } >- >+ > // for tag attribute >+ > public void setEscapeXml(boolean escapeXml) { > this.escapeXml = escapeXml; > } >Index: src/main/java/org/apache/taglibs/standard/tag/rt/core/ForTokensTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/rt/core/ForTokensTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/rt/core/ForTokensTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.rt.core; > >@@ -31,14 +31,14 @@ > */ > > public class ForTokensTag >- extends ForTokensSupport >- implements LoopTag, IterationTag >-{ >+ extends ForTokensSupport >+ implements LoopTag, IterationTag { > > //********************************************************************* > // Accessor methods > > // for tag attribute >+ > public void setBegin(int begin) throws JspTagException { > this.beginSpecified = true; > this.begin = begin; >@@ -46,6 +46,7 @@ > } > > // for tag attribute >+ > public void setEnd(int end) throws JspTagException { > this.endSpecified = true; > this.end = end; >@@ -53,6 +54,7 @@ > } > > // for tag attribute >+ > public void setStep(int step) throws JspTagException { > this.stepSpecified = true; > this.step = step; >@@ -60,19 +62,23 @@ > } > > // stores the 'items' Object we're passed >+ > public void setItems(Object s) throws JspTagException { > items = s; >- // use the empty string to indicate "no iteration" >- if (s == null) >- items = ""; >+ // use the empty string to indicate "no iteration" >+ if (s == null) { >+ items = ""; >+ } > } > > // stores the 'delims' String we're passed >+ > public void setDelims(String s) throws JspTagException { > delims = s; >- // use the empty string to cause monolithic tokenization >- if (s == null) >- delims = ""; >+ // use the empty string to cause monolithic tokenization >+ if (s == null) { >+ delims = ""; >+ } > } > > } >Index: src/main/java/org/apache/taglibs/standard/tag/rt/core/ImportTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/rt/core/ImportTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/rt/core/ImportTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.rt.core; > >@@ -34,16 +34,19 @@ > // Accessor methods > > // for tag attribute >+ > public void setUrl(String url) throws JspTagException { > this.url = url; > } > > // for tag attribute >+ > public void setContext(String context) throws JspTagException { > this.context = context; > } > > // for tag attribute >+ > public void setCharEncoding(String charEncoding) throws JspTagException { > this.charEncoding = charEncoding; > } >Index: src/main/java/org/apache/taglibs/standard/tag/rt/core/SetTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/rt/core/SetTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/rt/core/SetTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.rt.core; > >Index: src/main/java/org/apache/taglibs/standard/tag/rt/core/IfTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/rt/core/IfTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/rt/core/IfTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.rt.core; > >@@ -34,12 +34,14 @@ > // Constructor and lifecycle management > > // initialize inherited and local state >+ > public IfTag() { > super(); > init(); > } > > // Releases any resources we may have (or inherit) >+ > @Override > public void release() { > super.release(); >@@ -66,6 +68,7 @@ > // Accessors > > // receives the tag's 'test' attribute >+ > public void setTest(boolean test) { > this.test = test; > } >@@ -75,6 +78,7 @@ > // Private utility methods > > // resets internal state >+ > private void init() { > test = false; > } >Index: src/main/java/org/apache/taglibs/standard/tag/rt/core/ParamTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/rt/core/ParamTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/rt/core/ParamTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.rt.core; > >@@ -34,11 +34,13 @@ > // Accessor methods > > // for tag attribute >+ > public void setName(String name) throws JspTagException { > this.name = name; > } > > // for tag attribute >+ > public void setValue(String value) throws JspTagException { > this.value = value; > } >Index: src/main/java/org/apache/taglibs/standard/tag/rt/core/RedirectTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/rt/core/RedirectTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/rt/core/RedirectTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.rt.core; > >@@ -34,11 +34,13 @@ > // Accessor methods > > // for tag attribute >+ > public void setUrl(String url) throws JspTagException { > this.url = url; > } > > // for tag attribute >+ > public void setContext(String context) throws JspTagException { > this.context = context; > } >Index: src/main/java/org/apache/taglibs/standard/tag/rt/core/WhenTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/rt/core/WhenTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/rt/core/WhenTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.rt.core; > >@@ -31,12 +31,14 @@ > // Constructor and lifecycle management > > // initialize inherited and local state >+ > public WhenTag() { > super(); > init(); > } > > // Releases any resources we may have (or inherit) >+ > @Override > public void release() { > super.release(); >@@ -63,6 +65,7 @@ > // Accessors > > // receives the tag's 'test' attribute >+ > public void setTest(boolean test) { > this.test = test; > } >@@ -72,6 +75,7 @@ > // Private utility methods > > // resets internal state >+ > private void init() { > test = false; > } >Index: src/main/java/org/apache/taglibs/standard/tag/rt/core/UrlTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/rt/core/UrlTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/rt/core/UrlTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.rt.core; > >@@ -34,11 +34,13 @@ > // Accessor methods > > // for tag attribute >+ > public void setValue(String value) throws JspTagException { > this.value = value; > } > > // for tag attribute >+ > public void setContext(String context) throws JspTagException { > this.context = context; > } >Index: src/main/java/org/apache/taglibs/standard/tag/common/sql/SetDataSourceTagSupport.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/sql/SetDataSourceTagSupport.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/sql/SetDataSourceTagSupport.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.sql; > >@@ -31,7 +31,7 @@ > /** > * <p>Tag handler for <SetDataSource> in JSTL, used to create > * a simple DataSource for prototyping.</p> >- * >+ * > * @author Hans Bergsten > * @author Justyna Horwat > */ >@@ -52,16 +52,16 @@ > // Constructor and initialization > > public SetDataSourceTagSupport() { >- super(); >- init(); >+ super(); >+ init(); > } > > private void init() { >- dataSource = null; >- dataSourceSpecified = false; >- jdbcURL = driverClassName = userName = password = null; >- var = null; >- scope = PageContext.PAGE_SCOPE; >+ dataSource = null; >+ dataSourceSpecified = false; >+ jdbcURL = driverClassName = userName = password = null; >+ var = null; >+ scope = PageContext.PAGE_SCOPE; > } > > >@@ -71,14 +71,13 @@ > /** > * Setter method for the scope of the variable to hold the > * result. >- * > */ > public void setScope(String scope) { > this.scope = Util.getScope(scope); > } > > public void setVar(String var) { >- this.var = var; >+ this.var = var; > } > > >@@ -92,10 +91,10 @@ > if (dataSource != null) { > ds = DataSourceUtil.getDataSource(dataSource, pageContext); > } else { >- if (dataSourceSpecified) { >- throw new JspException( >- Resources.getMessage("SQL_DATASOURCE_NULL")); >- } >+ if (dataSourceSpecified) { >+ throw new JspException( >+ Resources.getMessage("SQL_DATASOURCE_NULL")); >+ } > > DataSourceWrapper dsw = new DataSourceWrapper(); > try { >@@ -106,27 +105,28 @@ > } > catch (Exception e) { > throw new JspTagException( >- Resources.getMessage("DRIVER_INVALID_CLASS", >- e.toString()), e); >+ Resources.getMessage("DRIVER_INVALID_CLASS", >+ e.toString()), e); > } > dsw.setJdbcURL(jdbcURL); > dsw.setUserName(userName); > dsw.setPassword(password); >- ds = (DataSource) dsw; >+ ds = (DataSource) dsw; > } > > if (var != null) { >- pageContext.setAttribute(var, ds, scope); >+ pageContext.setAttribute(var, ds, scope); > } else { > Config.set(pageContext, Config.SQL_DATA_SOURCE, ds, scope); > } > >- return SKIP_BODY; >+ return SKIP_BODY; > } > > // Releases any resources we may have (or inherit) >+ > @Override > public void release() { >- init(); >+ init(); > } > } >Index: src/main/java/org/apache/taglibs/standard/tag/common/sql/ResultImpl.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/sql/ResultImpl.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/sql/ResultImpl.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.sql; > >@@ -29,10 +29,10 @@ > > /** > * <p>This class creates a cached version of a <tt>ResultSet</tt>. >- * It's represented as a <tt>Result</tt> implementation, capable of >- * returing an array of <tt>Row</tt> objects containing a <tt>Column</tt> >+ * It's represented as a <tt>Result</tt> implementation, capable of >+ * returing an array of <tt>Row</tt> objects containing a <tt>Column</tt> > * instance for each column in the row.</p> >- * >+ * <p/> > * <p>Note -- this is a private copy for the RI to avoid making the > * corresponding class in javax.servlet.* public.</p> > * >@@ -50,7 +50,7 @@ > * Build a <code>Result</code> object from a <code>ResultSet</code> object. > * > * @param rs an open <tt>ResultSet</tt>, positioned before the first row >- * @exception SQLException if a database error occurs >+ * @throws SQLException if a database error occurs > */ > public ResultImpl(ResultSet rs) throws SQLException { > this(rs, -1, -1); >@@ -59,9 +59,9 @@ > /** > * Build a <code>Result</code> object from a <code>ResultSet</code> object. > * >- * @param rs an open <tt>ResultSet</tt>, positioned before the first row >+ * @param rs an open <tt>ResultSet</tt>, positioned before the first row > * @param maxRows query maximum rows limit >- * @exception SQLException if a database error occurs >+ * @throws SQLException if a database error occurs > */ > public ResultImpl(ResultSet rs, int maxRows) throws SQLException { > // Matching API in ResultSupport - apologies for the bad >@@ -73,15 +73,14 @@ > * This constructor reads the ResultSet and saves a cached > * copy. > * >- * @param rs an open <tt>ResultSet</tt>, positioned before the first >- * row >+ * @param rs an open <tt>ResultSet</tt>, positioned before the first >+ * row > * @param startRow beginning row to be cached > * @param maxRows query maximum rows limit >- * @exception SQLException if a database error occurs >+ * @throws SQLException if a database error occurs > */ > public ResultImpl(ResultSet rs, int startRow, int maxRows) >- throws SQLException >- { >+ throws SQLException { > rowMap = new ArrayList(); > rowByIndex = new ArrayList(); > >@@ -91,7 +90,7 @@ > // Create the column name array > columnNames = new String[noOfColumns]; > for (int i = 1; i <= noOfColumns; i++) { >- columnNames[i-1] = rsmd.getColumnName(i); >+ columnNames[i - 1] = rsmd.getColumnName(i); > } > > // Throw away all rows upto startRow >@@ -103,21 +102,21 @@ > int processedRows = 0; > while (rs.next()) { > if ((maxRows != -1) && (processedRows == maxRows)) { >- isLimited = true; >+ isLimited = true; > break; > } > Object[] columns = new Object[noOfColumns]; >- SortedMap columnMap = >- new TreeMap(String.CASE_INSENSITIVE_ORDER); >+ SortedMap columnMap = >+ new TreeMap(String.CASE_INSENSITIVE_ORDER); > > // JDBC uses 1 as the lowest index! > for (int i = 1; i <= noOfColumns; i++) { >- Object value = rs.getObject(i); >+ Object value = rs.getObject(i); > if (rs.wasNull()) { > value = null; > } >- columns[i-1] = value; >- columnMap.put(columnNames[i-1], value); >+ columns[i - 1] = value; >+ columnMap.put(columnNames[i - 1], value); > } > rowMap.add(columnMap); > rowByIndex.add(columns); >@@ -140,7 +139,7 @@ > } > > //should just be able to return SortedMap[] object >- return (SortedMap []) rowMap.toArray(new SortedMap[0]); >+ return (SortedMap[]) rowMap.toArray(new SortedMap[0]); > } > > >@@ -157,7 +156,7 @@ > } > > //should just be able to return Object[][] object >- return (Object [][])rowByIndex.toArray(new Object[0][0]); >+ return (Object[][]) rowByIndex.toArray(new Object[0][0]); > } > > /** >@@ -175,7 +174,7 @@ > * Returns the number of rows in the cached ResultSet > * > * @return the number of cached rows, or -1 if the Result could >- * not be initialized due to SQLExceptions >+ * not be initialized due to SQLExceptions > */ > public int getRowCount() { > if (rowMap == null) { >Index: src/main/java/org/apache/taglibs/standard/tag/common/sql/DateParamTagSupport.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/sql/DateParamTagSupport.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/sql/DateParamTagSupport.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > package org.apache.taglibs.standard.tag.common.sql; > > import javax.servlet.jsp.JspException; >@@ -27,7 +27,7 @@ > /** > * <p>Tag handler for <Param> in JSTL, used to set > * parameter values for a SQL statement.</p> >- * >+ * > * @author Justyna Horwat > */ > >@@ -35,12 +35,12 @@ > > //********************************************************************* > // Private constants >- >+ > private static final String TIMESTAMP_TYPE = "timestamp"; > private static final String TIME_TYPE = "time"; > private static final String DATE_TYPE = "date"; >- > >+ > //********************************************************************* > // Protected state > >@@ -67,19 +67,19 @@ > > @Override > public int doEndTag() throws JspException { >- SQLExecutionTag parent = (SQLExecutionTag) >- findAncestorWithClass(this, SQLExecutionTag.class); >- if (parent == null) { >- throw new JspTagException( >- Resources.getMessage("SQL_PARAM_OUTSIDE_PARENT")); >- } >+ SQLExecutionTag parent = (SQLExecutionTag) >+ findAncestorWithClass(this, SQLExecutionTag.class); >+ if (parent == null) { >+ throw new JspTagException( >+ Resources.getMessage("SQL_PARAM_OUTSIDE_PARENT")); >+ } > > if (value != null) { > convertValue(); > } > >- parent.addSQLParameter(value); >- return EVAL_PAGE; >+ parent.addSQLParameter(value); >+ return EVAL_PAGE; > } > > >@@ -88,21 +88,21 @@ > > private void convertValue() throws JspException { > >- if ((type == null) || (type.equalsIgnoreCase(TIMESTAMP_TYPE))) { >- if (!(value instanceof java.sql.Timestamp)) { >- value = new java.sql.Timestamp(value.getTime()); >- } >- } else if (type.equalsIgnoreCase(TIME_TYPE)) { >- if (!(value instanceof java.sql.Time)) { >- value = new java.sql.Time(value.getTime()); >- } >- } else if (type.equalsIgnoreCase(DATE_TYPE)) { >- if (!(value instanceof java.sql.Date)) { >- value = new java.sql.Date(value.getTime()); >- } >- } else { >- throw new JspException( >- Resources.getMessage("SQL_DATE_PARAM_INVALID_TYPE", type)); >- } >+ if ((type == null) || (type.equalsIgnoreCase(TIMESTAMP_TYPE))) { >+ if (!(value instanceof java.sql.Timestamp)) { >+ value = new java.sql.Timestamp(value.getTime()); >+ } >+ } else if (type.equalsIgnoreCase(TIME_TYPE)) { >+ if (!(value instanceof java.sql.Time)) { >+ value = new java.sql.Time(value.getTime()); >+ } >+ } else if (type.equalsIgnoreCase(DATE_TYPE)) { >+ if (!(value instanceof java.sql.Date)) { >+ value = new java.sql.Date(value.getTime()); >+ } >+ } else { >+ throw new JspException( >+ Resources.getMessage("SQL_DATE_PARAM_INVALID_TYPE", type)); >+ } > } > } >Index: src/main/java/org/apache/taglibs/standard/tag/common/sql/DataSourceUtil.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/sql/DataSourceUtil.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/sql/DataSourceUtil.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.sql; > >@@ -32,9 +32,9 @@ > /** > * <p>A simple <code>DataSource</code> utility for the standard > * <code>DriverManager</code> class. >- * >+ * <p/> > * TO DO: need to cache DataSource >- * >+ * > * @author Justyna Horwat > */ > public class DataSourceUtil { >@@ -49,23 +49,22 @@ > * is > */ > static DataSource getDataSource(Object rawDataSource, PageContext pc) >- throws JspException >- { >- DataSource dataSource = null; >+ throws JspException { >+ DataSource dataSource = null; > > if (rawDataSource == null) { > rawDataSource = Config.find(pc, Config.SQL_DATA_SOURCE); > } > >- if (rawDataSource == null) { >- return null; >- } >+ if (rawDataSource == null) { >+ return null; >+ } > > /* >- * If the 'dataSource' attribute's value resolves to a String >- * after rtexpr/EL evaluation, use the string as JNDI path to >- * a DataSource >- */ >+ * If the 'dataSource' attribute's value resolves to a String >+ * after rtexpr/EL evaluation, use the string as JNDI path to >+ * a DataSource >+ */ > if (rawDataSource instanceof String) { > try { > Context ctx = new InitialContext(); >@@ -78,66 +77,64 @@ > } else if (rawDataSource instanceof DataSource) { > dataSource = (DataSource) rawDataSource; > } else { >- throw new JspException( >- Resources.getMessage("SQL_DATASOURCE_INVALID_TYPE")); >- } >+ throw new JspException( >+ Resources.getMessage("SQL_DATASOURCE_INVALID_TYPE")); >+ } > >- return dataSource; >+ return dataSource; > } > > /** > * Parse JDBC parameters and setup dataSource appropriately > */ > private static DataSource getDataSource(String params) >- throws JspException >- { >+ throws JspException { > DataSourceWrapper dataSource = new DataSourceWrapper(); > > String[] paramString = new String[4]; >- int escCount = 0; >- int aryCount = 0; >+ int escCount = 0; >+ int aryCount = 0; > int begin = 0; > >- for(int index=0; index < params.length(); index++) { >+ for (int index = 0; index < params.length(); index++) { > char nextChar = params.charAt(index); > if (TOKEN.indexOf(nextChar) != -1) { > if (escCount == 0) { >- paramString[aryCount] = params.substring(begin,index).trim(); >+ paramString[aryCount] = params.substring(begin, index).trim(); > begin = index + 1; > if (++aryCount > 4) { > throw new JspTagException( >- Resources.getMessage("JDBC_PARAM_COUNT")); >+ Resources.getMessage("JDBC_PARAM_COUNT")); > } > } > } > if (ESCAPE.indexOf(nextChar) != -1) { > escCount++; >- } >- else { >+ } else { > escCount = 0; > } > } > paramString[aryCount] = params.substring(begin).trim(); > >- // use the JDBC URL from the parameter string >+ // use the JDBC URL from the parameter string > dataSource.setJdbcURL(paramString[0]); > >- // try to load a driver if it's present >+ // try to load a driver if it's present > if (paramString[1] != null) { > try { > dataSource.setDriverClassName(paramString[1]); > } catch (Exception ex) { > throw new JspTagException( >- Resources.getMessage("DRIVER_INVALID_CLASS", >- ex.toString()), ex); >+ Resources.getMessage("DRIVER_INVALID_CLASS", >+ ex.toString()), ex); > } >- } >+ } > >- // set the username and password >+ // set the username and password > dataSource.setUserName(paramString[2]); > dataSource.setPassword(paramString[3]); > >- return dataSource; >+ return dataSource; > } > > } >Index: src/main/java/org/apache/taglibs/standard/tag/common/sql/ParamTagSupport.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/sql/ParamTagSupport.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/sql/ParamTagSupport.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > package org.apache.taglibs.standard.tag.common.sql; > > import javax.servlet.jsp.JspException; >@@ -27,7 +27,7 @@ > /** > * <p>Tag handler for <Param> in JSTL, used to set > * parameter values for a SQL statement.</p> >- * >+ * > * @author Hans Bergsten > */ > >@@ -39,25 +39,24 @@ > > @Override > public int doEndTag() throws JspException { >- SQLExecutionTag parent = (SQLExecutionTag) >- findAncestorWithClass(this, SQLExecutionTag.class); >- if (parent == null) { >- throw new JspTagException( >- Resources.getMessage("SQL_PARAM_OUTSIDE_PARENT")); >- } >+ SQLExecutionTag parent = (SQLExecutionTag) >+ findAncestorWithClass(this, SQLExecutionTag.class); >+ if (parent == null) { >+ throw new JspTagException( >+ Resources.getMessage("SQL_PARAM_OUTSIDE_PARENT")); >+ } > >- Object paramValue = null; >- if (value != null) { >- paramValue = value; >- } >- else if (bodyContent != null) { >- paramValue = bodyContent.getString().trim(); >- if (((String) paramValue).trim().length() == 0) { >- paramValue = null; >- } >- } >+ Object paramValue = null; >+ if (value != null) { >+ paramValue = value; >+ } else if (bodyContent != null) { >+ paramValue = bodyContent.getString().trim(); >+ if (((String) paramValue).trim().length() == 0) { >+ paramValue = null; >+ } >+ } > >- parent.addSQLParameter(paramValue); >- return EVAL_PAGE; >+ parent.addSQLParameter(paramValue); >+ return EVAL_PAGE; > } > } >Index: src/main/java/org/apache/taglibs/standard/tag/common/sql/DataSourceWrapper.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/sql/DataSourceWrapper.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/sql/DataSourceWrapper.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.sql; > >@@ -32,7 +32,7 @@ > /** > * <p>A simple <code>DataSource</code> wrapper for the standard > * <code>DriverManager</code> class. >- * >+ * > * @author Hans Bergsten > */ > public class DataSourceWrapper implements DataSource { >@@ -41,8 +41,8 @@ > private String userName; > private String password; > >- public void setDriverClassName(String driverClassName) >- throws ClassNotFoundException, InstantiationException, >+ public void setDriverClassName(String driverClassName) >+ throws ClassNotFoundException, InstantiationException, > IllegalAccessException { > > //get the classloader >@@ -52,11 +52,14 @@ > cl = Thread.currentThread().getContextClassLoader(); > } else { > cl = java.security.AccessController.doPrivileged( >- new java.security.PrivilegedAction<ClassLoader>() >- {public ClassLoader run() {return Thread.currentThread().getContextClassLoader();}}); >+ new java.security.PrivilegedAction<ClassLoader>() { >+ public ClassLoader run() { >+ return Thread.currentThread().getContextClassLoader(); >+ } >+ }); > } > //done getting classloader >- >+ > Object instance = Class.forName(driverClassName, true, cl).newInstance(); > if (instance instanceof Driver) { > driver = (Driver) instance; >@@ -64,15 +67,15 @@ > } > > public void setJdbcURL(String jdbcURL) { >- this.jdbcURL = jdbcURL; >+ this.jdbcURL = jdbcURL; > } > > public void setUserName(String userName) { >- this.userName = userName; >+ this.userName = userName; > } > > public void setPassword(String password) { >- this.password = password; >+ this.password = password; > } > > /** >@@ -100,44 +103,44 @@ > } > return conn; > } >- >+ > /** > * Always throws a SQLException. Username and password are set > * in the constructor and can not be changed. > */ >- public Connection getConnection(String username, String password) >+ public Connection getConnection(String username, String password) > throws SQLException { > throw new SQLException(Resources.getMessage("NOT_SUPPORTED")); > } >- >+ > /** > * Always throws a SQLException. Not supported. > */ > public int getLoginTimeout() throws SQLException { > throw new SQLException(Resources.getMessage("NOT_SUPPORTED")); > } >- >+ > /** > * Always throws a SQLException. Not supported. > */ > public PrintWriter getLogWriter() throws SQLException { > throw new SQLException(Resources.getMessage("NOT_SUPPORTED")); > } >- >+ > /** > * Always throws a SQLException. Not supported. > */ > public void setLoginTimeout(int seconds) throws SQLException { > throw new SQLException(Resources.getMessage("NOT_SUPPORTED")); > } >- >+ > /** > * Always throws a SQLException. Not supported. > */ > public synchronized void setLogWriter(PrintWriter out) throws SQLException { > throw new SQLException(Resources.getMessage("NOT_SUPPORTED")); > } >- >+ > public synchronized boolean isWrapperFor(Class c) throws SQLException { > throw new SQLException(Resources.getMessage("NOT_SUPPORTED")); > } >Index: src/main/java/org/apache/taglibs/standard/tag/common/sql/UpdateTagSupport.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/sql/UpdateTagSupport.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/sql/UpdateTagSupport.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.sql; > >@@ -35,14 +35,14 @@ > import org.apache.taglibs.standard.tag.common.core.Util; > > /** >- * <p>Tag handler for <Update> in JSTL. >- * >+ * <p>Tag handler for <Update> in JSTL. >+ * > * @author Hans Bergsten > * @author Justyna Horwat > */ > >-public abstract class UpdateTagSupport extends BodyTagSupport >- implements TryCatchFinally, SQLExecutionTag { >+public abstract class UpdateTagSupport extends BodyTagSupport >+ implements TryCatchFinally, SQLExecutionTag { > > private String var; > private int scope; >@@ -68,18 +68,18 @@ > // Constructor and initialization > > public UpdateTagSupport() { >- super(); >- init(); >+ super(); >+ init(); > } > > private void init() { >- rawDataSource = null; >- sql = null; >- conn = null; >- parameters = null; >- isPartOfTransaction = dataSourceSpecified = false; >+ rawDataSource = null; >+ sql = null; >+ conn = null; >+ parameters = null; >+ isPartOfTransaction = dataSourceSpecified = false; > scope = PageContext.PAGE_SCOPE; >- var = null; >+ var = null; > } > > >@@ -91,7 +91,7 @@ > * result. > */ > public void setVar(String var) { >- this.var = var; >+ this.var = var; > } > > /** >@@ -113,13 +113,13 @@ > @Override > public int doStartTag() throws JspException { > >- try { >- conn = getConnection(); >- } catch (SQLException e) { >- throw new JspException(sql + ": " + e.getMessage(), e); >- } >+ try { >+ conn = getConnection(); >+ } catch (SQLException e) { >+ throw new JspException(sql + ": " + e.getMessage(), e); >+ } > >- return EVAL_BODY_BUFFERED; >+ return EVAL_BODY_BUFFERED; > } > > /** >@@ -128,7 +128,7 @@ > * named by the <code>var</code> attribute in the scope specified > * by the <code>scope</code> attribute, as an object that implements > * the Result interface. >- * >+ * <p/> > * <p>The connection used to execute the statement comes either > * from the <code>DataSource</code> specified by the > * <code>dataSource</code> attribute, provided by a parent action >@@ -137,50 +137,50 @@ > */ > @Override > public int doEndTag() throws JspException { >- /* >- * Use the SQL statement specified by the sql attribute, if any, >- * otherwise use the body as the statement. >- */ >- String sqlStatement = null; >- if (sql != null) { >- sqlStatement = sql; >- } >- else if (bodyContent != null) { >- sqlStatement = bodyContent.getString(); >- } >- if (sqlStatement == null || sqlStatement.trim().length() == 0) { >- throw new JspTagException( >- Resources.getMessage("SQL_NO_STATEMENT")); >- } >+ /* >+ * Use the SQL statement specified by the sql attribute, if any, >+ * otherwise use the body as the statement. >+ */ >+ String sqlStatement = null; >+ if (sql != null) { >+ sqlStatement = sql; >+ } else if (bodyContent != null) { >+ sqlStatement = bodyContent.getString(); >+ } >+ if (sqlStatement == null || sqlStatement.trim().length() == 0) { >+ throw new JspTagException( >+ Resources.getMessage("SQL_NO_STATEMENT")); >+ } > >- int result = 0; >- PreparedStatement ps = null; >- try { >- ps = conn.prepareStatement(sqlStatement); >- setParameters(ps, parameters); >- result = ps.executeUpdate(); >- } >- catch (Throwable e) { >- throw new JspException(sqlStatement + ": " + e.getMessage(), e); >- } finally { >- if (ps != null) { >- try { >- ps.close(); >- } catch (SQLException sqe) { >- throw new JspException(sqe.getMessage(), sqe); >- } >- } >- } >- if (var != null) >- pageContext.setAttribute(var, new Integer(result), scope); >- return EVAL_PAGE; >+ int result = 0; >+ PreparedStatement ps = null; >+ try { >+ ps = conn.prepareStatement(sqlStatement); >+ setParameters(ps, parameters); >+ result = ps.executeUpdate(); >+ } >+ catch (Throwable e) { >+ throw new JspException(sqlStatement + ": " + e.getMessage(), e); >+ } finally { >+ if (ps != null) { >+ try { >+ ps.close(); >+ } catch (SQLException sqe) { >+ throw new JspException(sqe.getMessage(), sqe); >+ } >+ } >+ } >+ if (var != null) { >+ pageContext.setAttribute(var, new Integer(result), scope); >+ } >+ return EVAL_PAGE; > } > > /** > * Just rethrows the Throwable. > */ > public void doCatch(Throwable t) throws Throwable { >- throw t; >+ throw t; > } > > /** >@@ -188,16 +188,16 @@ > * as part of a transaction. > */ > public void doFinally() { >- if (conn != null && !isPartOfTransaction) { >- try { >- conn.close(); >- } catch (SQLException e) { >- // Not much we can do >- } >- } >+ if (conn != null && !isPartOfTransaction) { >+ try { >+ conn.close(); >+ } catch (SQLException e) { >+ // Not much we can do >+ } >+ } > >- parameters = null; >- conn = null; >+ parameters = null; >+ conn = null; > } > > >@@ -209,10 +209,10 @@ > * parameter values. > */ > public void addSQLParameter(Object o) { >- if (parameters == null) { >- parameters = new ArrayList(); >- } >- parameters.add(o); >+ if (parameters == null) { >+ parameters = new ArrayList(); >+ } >+ parameters.add(o); > } > > >@@ -220,50 +220,49 @@ > // Private utility methods > > private Connection getConnection() throws JspException, SQLException { >- // Fix: Add all other mechanisms >- Connection conn = null; >- isPartOfTransaction = false; >+ // Fix: Add all other mechanisms >+ Connection conn = null; >+ isPartOfTransaction = false; > >- TransactionTagSupport parent = (TransactionTagSupport) >- findAncestorWithClass(this, TransactionTagSupport.class); >- if (parent != null) { >+ TransactionTagSupport parent = (TransactionTagSupport) >+ findAncestorWithClass(this, TransactionTagSupport.class); >+ if (parent != null) { > if (dataSourceSpecified) { > throw new JspTagException( >- Resources.getMessage("ERROR_NESTED_DATASOURCE")); >+ Resources.getMessage("ERROR_NESTED_DATASOURCE")); > } >- conn = parent.getSharedConnection(); >+ conn = parent.getSharedConnection(); > isPartOfTransaction = true; >- } else { >- if ((rawDataSource == null) && dataSourceSpecified) { >- throw new JspException( >- Resources.getMessage("SQL_DATASOURCE_NULL")); >- } >- DataSource dataSource = DataSourceUtil.getDataSource(rawDataSource, >- pageContext); >+ } else { >+ if ((rawDataSource == null) && dataSourceSpecified) { >+ throw new JspException( >+ Resources.getMessage("SQL_DATASOURCE_NULL")); >+ } >+ DataSource dataSource = DataSourceUtil.getDataSource(rawDataSource, >+ pageContext); > try { > conn = dataSource.getConnection(); > } catch (Exception ex) { > throw new JspException( >- Resources.getMessage("DATASOURCE_INVALID", >- ex.toString())); >+ Resources.getMessage("DATASOURCE_INVALID", >+ ex.toString())); > } >- } >+ } > >- return conn; >+ return conn; > } > >- private void setParameters(PreparedStatement ps, List parameters) >- throws SQLException >- { >- if (parameters != null) { >- for (int i = 0; i < parameters.size(); i++) { >+ private void setParameters(PreparedStatement ps, List parameters) >+ throws SQLException { >+ if (parameters != null) { >+ for (int i = 0; i < parameters.size(); i++) { > /* The first parameter has index 1. If a null > * is passed to setObject the parameter will be > * set to JDBC null so an explicit call to > * ps.setNull is not required. > */ > ps.setObject(i + 1, parameters.get(i)); >- } >- } >+ } >+ } > } > } >Index: src/main/java/org/apache/taglibs/standard/tag/common/sql/QueryTagSupport.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/sql/QueryTagSupport.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/sql/QueryTagSupport.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.sql; > >@@ -21,37 +21,31 @@ > import java.sql.PreparedStatement; > import java.sql.ResultSet; > import java.sql.SQLException; >- > import java.util.ArrayList; > import java.util.List; > > import javax.servlet.jsp.JspException; > import javax.servlet.jsp.JspTagException; > import javax.servlet.jsp.PageContext; >- > import javax.servlet.jsp.jstl.core.Config; >- > import javax.servlet.jsp.jstl.sql.Result; > import javax.servlet.jsp.jstl.sql.SQLExecutionTag; >- > import javax.servlet.jsp.tagext.BodyTagSupport; > import javax.servlet.jsp.tagext.TryCatchFinally; >- > import javax.sql.DataSource; > > import org.apache.taglibs.standard.resources.Resources; >- > import org.apache.taglibs.standard.tag.common.core.Util; > > /** >- * <p>Tag handler for <Query> in JSTL. >- * >+ * <p>Tag handler for <Query> in JSTL. >+ * > * @author Hans Bergsten > * @author Justyna Horwat > */ > >-public abstract class QueryTagSupport extends BodyTagSupport >- implements TryCatchFinally, SQLExecutionTag { >+public abstract class QueryTagSupport extends BodyTagSupport >+ implements TryCatchFinally, SQLExecutionTag { > > private String var; > private int scope; >@@ -151,8 +145,8 @@ > maxRows = Integer.parseInt((String) obj); > } catch (NumberFormatException nfe) { > throw new JspException(Resources.getMessage("SQL_MAXROWS_PARSE_ERROR", >- (String) obj), >- nfe); >+ (String) obj), >+ nfe); > } > } else { > throw new JspException(Resources.getMessage("SQL_MAXROWS_INVALID")); >@@ -175,7 +169,7 @@ > * named by the <code>var</code> attribute in the scope specified > * by the <code>scope</code> attribute, as an object that implements > * the Result interface. >- * >+ * <p/> > * <p>The connection used to execute the statement comes either > * from the <code>DataSource</code> specified by the > * <code>dataSource</code> attribute, provided by a parent action >@@ -191,8 +185,7 @@ > String sqlStatement = null; > if (sql != null) { > sqlStatement = sql; >- } >- else if (bodyContent != null) { >+ } else if (bodyContent != null) { > sqlStatement = bodyContent.getString(); > } > if (sqlStatement == null || sqlStatement.trim().length() == 0) { >@@ -277,7 +270,8 @@ > if (conn != null && !isPartOfTransaction) { > try { > conn.close(); >- } catch (SQLException e) {} // Not much we can do >+ } catch (SQLException e) { >+ } // Not much we can do > } > > conn = null; >@@ -293,7 +287,7 @@ > Connection conn = null; > isPartOfTransaction = false; > >- TransactionTagSupport parent = (TransactionTagSupport)findAncestorWithClass(this, TransactionTagSupport.class); >+ TransactionTagSupport parent = (TransactionTagSupport) findAncestorWithClass(this, TransactionTagSupport.class); > if (parent != null) { > if (dataSourceSpecified) { > throw new JspTagException(Resources.getMessage("ERROR_NESTED_DATASOURCE")); >@@ -305,21 +299,20 @@ > throw new JspException(Resources.getMessage("SQL_DATASOURCE_NULL")); > } > DataSource dataSource = DataSourceUtil.getDataSource(rawDataSource, >- pageContext); >+ pageContext); > try { > conn = dataSource.getConnection(); > } catch (Exception ex) { >- throw new JspException(Resources.getMessage("DATASOURCE_INVALID", >- ex.toString())); >+ throw new JspException(Resources.getMessage("DATASOURCE_INVALID", >+ ex.toString())); > } > } > > return conn; > } > >- private void setParameters(PreparedStatement ps, List parameters) >- throws SQLException >- { >+ private void setParameters(PreparedStatement ps, List parameters) >+ throws SQLException { > if (parameters != null) { > for (int i = 0; i < parameters.size(); i++) { > /* The first parameter has index 1. If a null >Index: src/main/java/org/apache/taglibs/standard/tag/common/sql/TransactionTagSupport.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/sql/TransactionTagSupport.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/sql/TransactionTagSupport.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.sql; > >@@ -30,25 +30,25 @@ > > > /** >- * <p>Tag handler for <Transaction> in JSTL. >- * >+ * <p>Tag handler for <Transaction> in JSTL. >+ * > * @author Hans Bergsten > */ > >-public abstract class TransactionTagSupport extends TagSupport >- implements TryCatchFinally { >+public abstract class TransactionTagSupport extends TagSupport >+ implements TryCatchFinally { > > //********************************************************************* > // Private constants > > private static final String TRANSACTION_READ_COMMITTED >- = "read_committed"; >+ = "read_committed"; > private static final String TRANSACTION_READ_UNCOMMITTED >- = "read_uncommitted"; >+ = "read_uncommitted"; > private static final String TRANSACTION_REPEATABLE_READ >- = "repeatable_read"; >+ = "repeatable_read"; > private static final String TRANSACTION_SERIALIZABLE >- = "serializable"; >+ = "serializable"; > > > //********************************************************************* >@@ -70,15 +70,14 @@ > // Constructor and initialization > > public TransactionTagSupport() { >- super(); >- conn = null; >- dataSourceSpecified = false; >- rawDataSource = null; >- isolation = Connection.TRANSACTION_NONE; >+ super(); >+ conn = null; >+ dataSourceSpecified = false; >+ rawDataSource = null; >+ isolation = Connection.TRANSACTION_NONE; > } > > >- > //********************************************************************* > // Tag logic > >@@ -90,33 +89,33 @@ > @Override > public int doStartTag() throws JspException { > >- if ((rawDataSource == null) && dataSourceSpecified) { >- throw new JspException( >- Resources.getMessage("SQL_DATASOURCE_NULL")); >- } >+ if ((rawDataSource == null) && dataSourceSpecified) { >+ throw new JspException( >+ Resources.getMessage("SQL_DATASOURCE_NULL")); >+ } > > DataSource dataSource = DataSourceUtil.getDataSource(rawDataSource, >- pageContext); >+ pageContext); > >- try { >- conn = dataSource.getConnection(); >- origIsolation = conn.getTransactionIsolation(); >- if (origIsolation == Connection.TRANSACTION_NONE) { >- throw new JspTagException( >- Resources.getMessage("TRANSACTION_NO_SUPPORT")); >- } >- if ((isolation != Connection.TRANSACTION_NONE) >- && (isolation != origIsolation)) { >- conn.setTransactionIsolation(isolation); >- } >- conn.setAutoCommit(false); >- } catch (SQLException e) { >- throw new JspTagException( >- Resources.getMessage("ERROR_GET_CONNECTION", >- e.toString()), e); >- } >+ try { >+ conn = dataSource.getConnection(); >+ origIsolation = conn.getTransactionIsolation(); >+ if (origIsolation == Connection.TRANSACTION_NONE) { >+ throw new JspTagException( >+ Resources.getMessage("TRANSACTION_NO_SUPPORT")); >+ } >+ if ((isolation != Connection.TRANSACTION_NONE) >+ && (isolation != origIsolation)) { >+ conn.setTransactionIsolation(isolation); >+ } >+ conn.setAutoCommit(false); >+ } catch (SQLException e) { >+ throw new JspTagException( >+ Resources.getMessage("ERROR_GET_CONNECTION", >+ e.toString()), e); >+ } > >- return EVAL_BODY_INCLUDE; >+ return EVAL_BODY_INCLUDE; > } > > /** >@@ -124,28 +123,28 @@ > */ > @Override > public int doEndTag() throws JspException { >- try { >- conn.commit(); >- } catch (SQLException e) { >- throw new JspTagException( >- Resources.getMessage("TRANSACTION_COMMIT_ERROR", >- e.toString()), e); >- } >- return EVAL_PAGE; >+ try { >+ conn.commit(); >+ } catch (SQLException e) { >+ throw new JspTagException( >+ Resources.getMessage("TRANSACTION_COMMIT_ERROR", >+ e.toString()), e); >+ } >+ return EVAL_PAGE; > } > > /** > * Rollbacks the transaction and rethrows the Throwable. > */ > public void doCatch(Throwable t) throws Throwable { >- if (conn != null) { >- try { >- conn.rollback(); >- } catch (SQLException e) { >- // Ignore to not hide orignal exception >- } >- } >- throw t; >+ if (conn != null) { >+ try { >+ conn.rollback(); >+ } catch (SQLException e) { >+ // Ignore to not hide orignal exception >+ } >+ } >+ throw t; > } > > /** >@@ -153,27 +152,28 @@ > * closes it. > */ > public void doFinally() { >- if (conn != null) { >- try { >- if ((isolation != Connection.TRANSACTION_NONE) >- && (isolation != origIsolation)) { >- conn.setTransactionIsolation(origIsolation); >- } >- conn.setAutoCommit(true); >- conn.close(); >- } catch (SQLException e) { >- // Not much we can do >- } >- } >- conn = null; >- isolation = Connection.TRANSACTION_NONE; >+ if (conn != null) { >+ try { >+ if ((isolation != Connection.TRANSACTION_NONE) >+ && (isolation != origIsolation)) { >+ conn.setTransactionIsolation(origIsolation); >+ } >+ conn.setAutoCommit(true); >+ conn.close(); >+ } catch (SQLException e) { >+ // Not much we can do >+ } >+ } >+ conn = null; >+ isolation = Connection.TRANSACTION_NONE; > } > > // Releases any resources we may have (or inherit) >+ > @Override > public void release() { >- dataSourceSpecified = false; >- rawDataSource = null; >+ dataSourceSpecified = false; >+ rawDataSource = null; > } > > >@@ -185,18 +185,18 @@ > */ > public void setIsolation(String iso) throws JspTagException { > >- if (TRANSACTION_READ_COMMITTED.equals(iso)) { >- isolation = Connection.TRANSACTION_READ_COMMITTED; >- } else if (TRANSACTION_READ_UNCOMMITTED.equals(iso)) { >- isolation = Connection.TRANSACTION_READ_UNCOMMITTED; >- } else if (TRANSACTION_REPEATABLE_READ.equals(iso)) { >- isolation = Connection.TRANSACTION_REPEATABLE_READ; >- } else if (TRANSACTION_SERIALIZABLE.equals(iso)) { >- isolation = Connection.TRANSACTION_SERIALIZABLE; >- } else { >- throw new JspTagException( >- Resources.getMessage("TRANSACTION_INVALID_ISOLATION")); >- } >+ if (TRANSACTION_READ_COMMITTED.equals(iso)) { >+ isolation = Connection.TRANSACTION_READ_COMMITTED; >+ } else if (TRANSACTION_READ_UNCOMMITTED.equals(iso)) { >+ isolation = Connection.TRANSACTION_READ_UNCOMMITTED; >+ } else if (TRANSACTION_REPEATABLE_READ.equals(iso)) { >+ isolation = Connection.TRANSACTION_REPEATABLE_READ; >+ } else if (TRANSACTION_SERIALIZABLE.equals(iso)) { >+ isolation = Connection.TRANSACTION_SERIALIZABLE; >+ } else { >+ throw new JspTagException( >+ Resources.getMessage("TRANSACTION_INVALID_ISOLATION")); >+ } > } > > /** >@@ -204,6 +204,6 @@ > * the Connection. > */ > public Connection getSharedConnection() { >- return conn; >+ return conn; > } > } >Index: src/main/java/org/apache/taglibs/standard/tag/common/xml/UnresolvableException.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/xml/UnresolvableException.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/xml/UnresolvableException.java (working copy) >@@ -27,18 +27,20 @@ > /** > * Create an UnresolvableException object that holds > * an error message. >+ * > * @param message The error message. > */ > public UnresolvableException(String message) { > super(message); > } >- >+ > /** > * Create an UnresolvableException object that holds > * an error message, and another exception > * that caused this exception. >+ * > * @param message The error message. >- * @param e The exception that caused this exception. >+ * @param e The exception that caused this exception. > */ > public UnresolvableException(String message, Exception e) { > super(message, e); >Index: src/main/java/org/apache/taglibs/standard/tag/common/xml/XPathUtil.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/xml/XPathUtil.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/xml/XPathUtil.java (working copy) >@@ -57,45 +57,46 @@ > // would ideally be a base class, but some of our user handlers already > // have their own parents > public class XPathUtil { >- >+ > //********************************************************************* > // Constructor >- >+ > /** > * Constructs a new XPathUtil object associated with the given > * PageContext. > */ > public XPathUtil(PageContext pc) { > pageContext = pc; >- } >- >- int globalVarSize=0; >- public Vector getVariableQNames ( ) { >+ } > >+ int globalVarSize = 0; >+ >+ public Vector getVariableQNames() { >+ > globalVarSize = 0; >- Vector variableVector = new Vector ( ); >+ Vector variableVector = new Vector(); > // Now construct attributes in different scopes >- Enumeration enum_ = pageContext.getAttributeNamesInScope( >- PageContext.PAGE_SCOPE ); >- while ( enum_.hasMoreElements() ) { >- String varName = (String)enum_.nextElement(); >- QName varQName = new QName ( PAGE_NS_URL, PAGE_P, varName); >+ Enumeration enum_ = pageContext.getAttributeNamesInScope( >+ PageContext.PAGE_SCOPE); >+ while (enum_.hasMoreElements()) { >+ String varName = (String) enum_.nextElement(); >+ QName varQName = new QName(PAGE_NS_URL, PAGE_P, varName); > //Adding both namespace qualified QName and just localName >- variableVector.addElement( varQName ); >+ variableVector.addElement(varQName); > globalVarSize++; >- >- variableVector.addElement( new QName(null, varName ) ); >+ >+ variableVector.addElement(new QName(null, varName)); > globalVarSize++; > } >- enum_ = pageContext.getAttributeNamesInScope( >- PageContext.REQUEST_SCOPE ); >- while ( enum_.hasMoreElements() ) { >- String varName = (String)enum_.nextElement(); >- QName varQName = new QName ( REQUEST_NS_URL,REQUEST_P, varName); >+ enum_ = pageContext.getAttributeNamesInScope( >+ PageContext.REQUEST_SCOPE); >+ while (enum_.hasMoreElements()) { >+ String varName = (String) enum_.nextElement(); >+ QName varQName = new QName(REQUEST_NS_URL, REQUEST_P, varName); > //Adding both namespace qualified QName and just localName >- variableVector.addElement( varQName ); >+ variableVector.addElement(varQName); > globalVarSize++; >- variableVector.addElement( new QName(null, varName ) ); >+ variableVector.addElement(new QName(null, varName)); > globalVarSize++; > } > >@@ -103,90 +104,90 @@ > // we may have a page directive preventing session creation/access > // do not attempt to retrieve attribute names in session scope > // @see [ http://issues.apache.org/bugzilla/show_bug.cgi?id=35216 ] >- enum_ = pageContext.getAttributeNamesInScope( >- PageContext.SESSION_SCOPE ); >- while ( enum_.hasMoreElements() ) { >- String varName = (String)enum_.nextElement(); >- QName varQName = new QName ( SESSION_NS_URL, SESSION_P,varName); >+ enum_ = pageContext.getAttributeNamesInScope( >+ PageContext.SESSION_SCOPE); >+ while (enum_.hasMoreElements()) { >+ String varName = (String) enum_.nextElement(); >+ QName varQName = new QName(SESSION_NS_URL, SESSION_P, varName); > //Adding both namespace qualified QName and just localName >- variableVector.addElement( varQName ); >+ variableVector.addElement(varQName); > globalVarSize++; >- variableVector.addElement( new QName(null, varName ) ); >+ variableVector.addElement(new QName(null, varName)); > globalVarSize++; > } > } > >- enum_ = pageContext.getAttributeNamesInScope( >- PageContext.APPLICATION_SCOPE ); >- while ( enum_.hasMoreElements() ) { >- String varName = (String)enum_.nextElement(); >- QName varQName = new QName ( APP_NS_URL, APP_P,varName ); >+ enum_ = pageContext.getAttributeNamesInScope( >+ PageContext.APPLICATION_SCOPE); >+ while (enum_.hasMoreElements()) { >+ String varName = (String) enum_.nextElement(); >+ QName varQName = new QName(APP_NS_URL, APP_P, varName); > //Adding both namespace qualified QName and just localName >- variableVector.addElement( varQName ); >+ variableVector.addElement(varQName); > globalVarSize++; >- variableVector.addElement( new QName(null, varName ) ); >+ variableVector.addElement(new QName(null, varName)); > globalVarSize++; > } > enum_ = pageContext.getRequest().getParameterNames(); >- while ( enum_.hasMoreElements() ) { >- String varName = (String)enum_.nextElement(); >- QName varQName = new QName ( PARAM_NS_URL, PARAM_P,varName ); >+ while (enum_.hasMoreElements()) { >+ String varName = (String) enum_.nextElement(); >+ QName varQName = new QName(PARAM_NS_URL, PARAM_P, varName); > //Adding both namespace qualified QName and just localName >- variableVector.addElement( varQName ); >+ variableVector.addElement(varQName); > globalVarSize++; > } > enum_ = pageContext.getServletContext().getInitParameterNames(); >- while ( enum_.hasMoreElements() ) { >- String varName = (String)enum_.nextElement(); >- QName varQName = new QName ( INITPARAM_NS_URL, INITPARAM_P,varName ); >+ while (enum_.hasMoreElements()) { >+ String varName = (String) enum_.nextElement(); >+ QName varQName = new QName(INITPARAM_NS_URL, INITPARAM_P, varName); > //Adding both namespace qualified QName and just localName >- variableVector.addElement( varQName ); >+ variableVector.addElement(varQName); > globalVarSize++; > } >- enum_ = ((HttpServletRequest)pageContext.getRequest()).getHeaderNames(); >- while ( enum_.hasMoreElements() ) { >- String varName = (String)enum_.nextElement(); >- QName varQName = new QName ( HEADER_NS_URL, HEADER_P,varName ); >+ enum_ = ((HttpServletRequest) pageContext.getRequest()).getHeaderNames(); >+ while (enum_.hasMoreElements()) { >+ String varName = (String) enum_.nextElement(); >+ QName varQName = new QName(HEADER_NS_URL, HEADER_P, varName); > //Adding namespace qualified QName >- variableVector.addElement( varQName ); >+ variableVector.addElement(varQName); > globalVarSize++; > } >- Cookie[] c= ((HttpServletRequest)pageContext.getRequest()).getCookies(); >- if ( c!= null ) { >- for (int i = 0; i < c.length; i++) { >- String varName = c[i].getName(); >- QName varQName = new QName ( COOKIE_NS_URL, COOKIE_P,varName ); >+ Cookie[] c = ((HttpServletRequest) pageContext.getRequest()).getCookies(); >+ if (c != null) { >+ for (int i = 0; i < c.length; i++) { >+ String varName = c[i].getName(); >+ QName varQName = new QName(COOKIE_NS_URL, COOKIE_P, varName); > //Adding namespace qualified QName >- variableVector.addElement( varQName ); >+ variableVector.addElement(varQName); > globalVarSize++; > } > } > > return variableVector; >- >+ > } >- >+ > //********************************************************************* > // Support for JSTL variable resolution >- >+ > // The URLs > private static final String PAGE_NS_URL >- = "http://java.sun.com/jstl/xpath/page"; >+ = "http://java.sun.com/jstl/xpath/page"; > private static final String REQUEST_NS_URL >- = "http://java.sun.com/jstl/xpath/request"; >+ = "http://java.sun.com/jstl/xpath/request"; > private static final String SESSION_NS_URL >- = "http://java.sun.com/jstl/xpath/session"; >+ = "http://java.sun.com/jstl/xpath/session"; > private static final String APP_NS_URL >- = "http://java.sun.com/jstl/xpath/app"; >+ = "http://java.sun.com/jstl/xpath/app"; > private static final String PARAM_NS_URL >- = "http://java.sun.com/jstl/xpath/param"; >+ = "http://java.sun.com/jstl/xpath/param"; > private static final String INITPARAM_NS_URL >- = "http://java.sun.com/jstl/xpath/initParam"; >+ = "http://java.sun.com/jstl/xpath/initParam"; > private static final String COOKIE_NS_URL >- = "http://java.sun.com/jstl/xpath/cookie"; >+ = "http://java.sun.com/jstl/xpath/cookie"; > private static final String HEADER_NS_URL >- = "http://java.sun.com/jstl/xpath/header"; >- >+ = "http://java.sun.com/jstl/xpath/header"; >+ > // The prefixes > private static final String PAGE_P = "pageScope"; > private static final String REQUEST_P = "requestScope"; >@@ -196,194 +197,196 @@ > private static final String INITPARAM_P = "initParam"; > private static final String COOKIE_P = "cookie"; > private static final String HEADER_P = "header"; >- >+ > /** >- * org.apache.xpath.VariableStack defines a class to keep track of a stack >- * for template arguments and variables. >+ * org.apache.xpath.VariableStack defines a class to keep track of a stack >+ * for template arguments and variables. > * JstlVariableContext customizes it so it handles JSTL custom > * variable-mapping rules. > */ > protected class JstlVariableContext extends org.apache.xpath.VariableStack { >- >- public JstlVariableContext( ) { >+ >+ public JstlVariableContext() { > super(); > } >- >+ > /** > * Get a variable as an XPath object based on it's qualified name. >- * We override the base class method so JSTL's custom variable-mapping >+ * We override the base class method so JSTL's custom variable-mapping > * rules can be applied. > * > * @param xctxt The XPath context. @@@ we don't use it... >- * (from xalan: which must be passed in order to lazy evaluate variables.) >+ * (from xalan: which must be passed in order to lazy evaluate variables.) > * @param qname The qualified name of the variable. > */ > @Override > public XObject getVariableOrParam( >- XPathContext xctxt, >- org.apache.xml.utils.QName qname) >- throws javax.xml.transform.TransformerException, UnresolvableException >- { >+ XPathContext xctxt, >+ org.apache.xml.utils.QName qname) >+ throws javax.xml.transform.TransformerException, UnresolvableException { > //p( "***********************************getVariableOrParam begin****"); > String namespace = qname.getNamespaceURI(); > String prefix = qname.getPrefix(); > String localName = qname.getLocalName(); >- >+ > //p("namespace:prefix:localname=>"+ namespace > // + ":" + prefix +":" + localName ); >- >+ > try { >- Object varObject = getVariableValue(namespace,prefix,localName); >+ Object varObject = getVariableValue(namespace, prefix, localName); > > > //XObject varObject = myvs.getVariableOrParam( xpathSupport, varQName); >- XObject newXObject = new XObject( varObject); >+ XObject newXObject = new XObject(varObject); > >- if ( Class.forName("org.w3c.dom.Document").isInstance( varObject) ) { >+ if (Class.forName("org.w3c.dom.Document").isInstance(varObject)) { > >- NodeList nl= ((Document)varObject).getChildNodes(); >+ NodeList nl = ((Document) varObject).getChildNodes(); > // To allow non-welformed document > Vector nodeVector = new Vector(); >- for ( int i=0; i<nl.getLength(); i++ ) { >+ for (int i = 0; i < nl.getLength(); i++) { > Node currNode = nl.item(i); >- if ( currNode.getNodeType() == Node.ELEMENT_NODE ) { >- nodeVector.addElement( currNode); >+ if (currNode.getNodeType() == Node.ELEMENT_NODE) { >+ nodeVector.addElement(currNode); > } > } >- JSTLNodeList jstlNodeList = new JSTLNodeList( nodeVector); >- newXObject = new XNodeSetForDOM( jstlNodeList, xctxt ); >- >+ JSTLNodeList jstlNodeList = new JSTLNodeList(nodeVector); >+ newXObject = new XNodeSetForDOM(jstlNodeList, xctxt); >+ > return newXObject; >- >- } >- if ( Class.forName( >- "org.apache.taglibs.standard.tag.common.xml.JSTLNodeList").isInstance( >- varObject) ) { >- JSTLNodeList jstlNodeList = (JSTLNodeList)varObject; >- if ( ( jstlNodeList.getLength() == 1 ) && >- (!Class.forName("org.w3c.dom.Node").isInstance( jstlNodeList.elementAt(0) ) ) ) { >+ >+ } >+ if (Class.forName( >+ "org.apache.taglibs.standard.tag.common.xml.JSTLNodeList").isInstance( >+ varObject)) { >+ JSTLNodeList jstlNodeList = (JSTLNodeList) varObject; >+ if ((jstlNodeList.getLength() == 1) && >+ (!Class.forName("org.w3c.dom.Node").isInstance(jstlNodeList.elementAt(0)))) { > varObject = jstlNodeList.elementAt(0); > //Now we need to allow this primitive type to be coverted > // to type which Xalan XPath understands > } else { >- return new XNodeSetForDOM ( jstlNodeList ,xctxt ); >+ return new XNodeSetForDOM(jstlNodeList, xctxt); > } >- } >- if (Class.forName("org.w3c.dom.Node").isInstance( varObject)) { >- newXObject = new XNodeSetForDOM ( new JSTLNodeList( (Node)varObject ),xctxt ); >- } else if ( Class.forName("java.lang.String").isInstance( varObject)){ >- newXObject = new XString ( (String)varObject ); >- } else if ( Class.forName("java.lang.Boolean").isInstance( varObject) ) { >- newXObject = new XBoolean ( (Boolean)varObject ); >- } else if ( Class.forName("java.lang.Number").isInstance( varObject) ) { >- newXObject = new XNumber ( (Number)varObject ); >- } >+ } >+ if (Class.forName("org.w3c.dom.Node").isInstance(varObject)) { >+ newXObject = new XNodeSetForDOM(new JSTLNodeList((Node) varObject), xctxt); >+ } else if (Class.forName("java.lang.String").isInstance(varObject)) { >+ newXObject = new XString((String) varObject); >+ } else if (Class.forName("java.lang.Boolean").isInstance(varObject)) { >+ newXObject = new XBoolean((Boolean) varObject); >+ } else if (Class.forName("java.lang.Number").isInstance(varObject)) { >+ newXObject = new XNumber((Number) varObject); >+ } > > return newXObject; >- // myvs.setGlobalVariable( i, newXObject ); >- } catch ( ClassNotFoundException cnfe ) { >+ // myvs.setGlobalVariable( i, newXObject ); >+ } catch (ClassNotFoundException cnfe) { > // This shouldn't happen (TODO: LOG) >- System.out.println("CLASS NOT FOUND EXCEPTION :" + cnfe ); >- } >+ System.out.println("CLASS NOT FOUND EXCEPTION :" + cnfe); >+ } > //System.out.println("*****getVariableOrParam returning *null*" ); >- return null ; >+ return null; > } >- >+ > /** >- * Retrieve an XPath's variable value using JSTL's custom >+ * Retrieve an XPath's variable value using JSTL's custom > * variable-mapping rules > */ > public Object getVariableValue( >- String namespace, >- String prefix, >- String localName) >- throws UnresolvableException >- { >+ String namespace, >+ String prefix, >+ String localName) >+ throws UnresolvableException { > // p("resolving: ns=" + namespace + " prefix=" + prefix + " localName=" + localName); > // We can match on namespace with Xalan but leaving as is > // [ I 'd prefer to match on namespace, but this doesn't appear > // to work in Jaxen] > if (prefix == null || prefix.equals("")) { > return notNull( >- pageContext.findAttribute(localName), >- prefix, >- localName); >+ pageContext.findAttribute(localName), >+ prefix, >+ localName); > } else if (prefix.equals(PAGE_P)) { > return notNull( >- pageContext.getAttribute(localName,PageContext.PAGE_SCOPE), >- prefix, >- localName); >+ pageContext.getAttribute(localName, PageContext.PAGE_SCOPE), >+ prefix, >+ localName); > } else if (prefix.equals(REQUEST_P)) { > return notNull( >- pageContext.getAttribute(localName, >- PageContext.REQUEST_SCOPE), >- prefix, >- localName); >+ pageContext.getAttribute(localName, >+ PageContext.REQUEST_SCOPE), >+ prefix, >+ localName); > } else if (prefix.equals(SESSION_P)) { > return notNull( >- pageContext.getAttribute(localName, >- PageContext.SESSION_SCOPE), >- prefix, >- localName); >+ pageContext.getAttribute(localName, >+ PageContext.SESSION_SCOPE), >+ prefix, >+ localName); > } else if (prefix.equals(APP_P)) { > return notNull( >- pageContext.getAttribute(localName, >- PageContext.APPLICATION_SCOPE), >- prefix, >- localName); >+ pageContext.getAttribute(localName, >+ PageContext.APPLICATION_SCOPE), >+ prefix, >+ localName); > } else if (prefix.equals(PARAM_P)) { > return notNull( >- pageContext.getRequest().getParameter(localName), >- prefix, >- localName); >+ pageContext.getRequest().getParameter(localName), >+ prefix, >+ localName); > } else if (prefix.equals(INITPARAM_P)) { > return notNull( >- pageContext.getServletContext(). >- getInitParameter(localName), >- prefix, >- localName); >+ pageContext.getServletContext(). >+ getInitParameter(localName), >+ prefix, >+ localName); > } else if (prefix.equals(HEADER_P)) { > HttpServletRequest hsr = >- (HttpServletRequest) pageContext.getRequest(); >+ (HttpServletRequest) pageContext.getRequest(); > return notNull( >- hsr.getHeader(localName), >- prefix, >- localName); >+ hsr.getHeader(localName), >+ prefix, >+ localName); > } else if (prefix.equals(COOKIE_P)) { > HttpServletRequest hsr = >- (HttpServletRequest) pageContext.getRequest(); >+ (HttpServletRequest) pageContext.getRequest(); > Cookie[] c = hsr.getCookies(); >- for (int i = 0; i < c.length; i++) >- if (c[i].getName().equals(localName)) >+ for (int i = 0; i < c.length; i++) { >+ if (c[i].getName().equals(localName)) { > return c[i].getValue(); >+ } >+ } > throw new UnresolvableException("$" + prefix + ":" + localName); > } else { > throw new UnresolvableException("$" + prefix + ":" + localName); > } >- } >- >+ } >+ > /** > * Validate that the Object returned is not null. If it is > * null, throw an exception. > */ > private Object notNull(Object o, String prefix, String localName) >- throws UnresolvableException { >+ throws UnresolvableException { > if (o == null) { >- throw new UnresolvableException("$" + (prefix==null?"":prefix+":") + localName); >+ throw new UnresolvableException("$" + (prefix == null ? "" : prefix + ":") + localName); > } > //p("resolved to: " + o); > return o; >- } >+ } > } >- >+ > //********************************************************************* > // Support for XPath evaluation >- >+ > private PageContext pageContext; > private static HashMap exprCache; > private static JSTLPrefixResolver jstlPrefixResolver = null; >- >- /** Initialize globally useful data. */ >+ >+ /** >+ * Initialize globally useful data. >+ */ > private synchronized static void staticInit() { > if (jstlPrefixResolver == null) { > // register supported namespaces >@@ -396,48 +399,48 @@ > jstlPrefixResolver.addNamespace("initParam", INITPARAM_NS_URL); > jstlPrefixResolver.addNamespace("header", HEADER_NS_URL); > jstlPrefixResolver.addNamespace("cookie", COOKIE_NS_URL); >- >- >+ >+ > // create a HashMap to cache the expressions > exprCache = new HashMap(); > } > } >- >+ > static DocumentBuilderFactory dbf = null; > static DocumentBuilder db = null; > static Document d = null; >- >- static Document getDummyDocument( ) { >+ >+ static Document getDummyDocument() { > try { >- if ( dbf == null ) { >+ if (dbf == null) { > dbf = DocumentBuilderFactory.newInstance(); >- dbf.setNamespaceAware( true ); >- dbf.setValidating( false ); >+ dbf.setNamespaceAware(true); >+ dbf.setValidating(false); > } > db = dbf.newDocumentBuilder(); > > DOMImplementation dim = db.getDOMImplementation(); >- d = dim.createDocument("http://java.sun.com/jstl", "dummyroot", null); >+ d = dim.createDocument("http://java.sun.com/jstl", "dummyroot", null); > //d = db.newDocument(); > return d; >- } catch ( Exception e ) { >+ } catch (Exception e) { > e.printStackTrace(); > } > return null; > } > >- static Document getDummyDocumentWithoutRoot( ) { >+ static Document getDummyDocumentWithoutRoot() { > try { >- if ( dbf == null ) { >+ if (dbf == null) { > dbf = DocumentBuilderFactory.newInstance(); >- dbf.setNamespaceAware( true ); >- dbf.setValidating( false ); >+ dbf.setNamespaceAware(true); >+ dbf.setValidating(false); > } > db = dbf.newDocumentBuilder(); > > d = db.newDocument(); > return d; >- } catch ( Exception e ) { >+ } catch (Exception e) { > e.printStackTrace(); > } > return null; >@@ -449,97 +452,94 @@ > doc.appendChild(importedNode); > return doc; > } >- >+ > // The following variable is used for holding the modified xpath string > // when adapting parameter for Xalan XPath engine, where we need to have > // a Non null context node. > String modifiedXPath = null; >- > >- >- >- >+ > /** >- * Evaluate an XPath expression to a String value. >+ * Evaluate an XPath expression to a String value. > */ >- public String valueOf(Node n, String xpath) throws JspTagException { >+ public String valueOf(Node n, String xpath) throws JspTagException { > //p("******** valueOf(" + n + ", " + xpath + ")"); > staticInit(); > // @@@ but where do we set the Pag4eContext for the varaiblecontext? > JstlVariableContext vs = new JstlVariableContext(); > XPathContext xpathSupport = new XPathContext(); >- xpathSupport.setVarStack( vs); >- >- Vector varVector = fillVarStack(vs, xpathSupport); >- >- Node contextNode = adaptParamsForXalan( vs, n, xpath.trim() ); >- >+ xpathSupport.setVarStack(vs); >+ >+ Vector varVector = fillVarStack(vs, xpathSupport); >+ >+ Node contextNode = adaptParamsForXalan(vs, n, xpath.trim()); >+ > xpath = modifiedXPath; >- >+ > //p("******** valueOf: modified xpath: " + xpath); > >- XObject result = JSTLXPathAPI.eval( contextNode, xpath, >- jstlPrefixResolver,xpathSupport, varVector); >+ XObject result = JSTLXPathAPI.eval(contextNode, xpath, >+ jstlPrefixResolver, xpathSupport, varVector); > >- >+ > //p("******Result TYPE => " + result.getTypeString() ); >- >+ > String resultString = result.str(); > //p("******** valueOf: after eval: " + resultString); >- >+ > return resultString; >- >- } > >- /** >- * Evaluate an XPath expression to a boolean value. >+ } >+ >+ /** >+ * Evaluate an XPath expression to a boolean value. > */ > public boolean booleanValueOf(Node n, String xpath) >- throws JspTagException { >- >+ throws JspTagException { >+ > staticInit(); > JstlVariableContext vs = new JstlVariableContext(); > XPathContext xpathSupport = new XPathContext(); >- xpathSupport.setVarStack( vs); >- >- Vector varVector = fillVarStack(vs, xpathSupport); >- >- Node contextNode = adaptParamsForXalan( vs, n, xpath.trim() ); >+ xpathSupport.setVarStack(vs); >+ >+ Vector varVector = fillVarStack(vs, xpathSupport); >+ >+ Node contextNode = adaptParamsForXalan(vs, n, xpath.trim()); > xpath = modifiedXPath; >- >- XObject result = JSTLXPathAPI.eval( contextNode, xpath, >- jstlPrefixResolver, xpathSupport, varVector); >- >+ >+ XObject result = JSTLXPathAPI.eval(contextNode, xpath, >+ jstlPrefixResolver, xpathSupport, varVector); >+ > try { > return result.bool(); > } catch (TransformerException ex) { > throw new JspTagException( >- Resources.getMessage("XPATH_ERROR_XOBJECT", ex.toString()), ex); >+ Resources.getMessage("XPATH_ERROR_XOBJECT", ex.toString()), ex); > } > } >- >- /** >- * Evaluate an XPath expression to a List of nodes. >+ >+ /** >+ * Evaluate an XPath expression to a List of nodes. > */ >- public List selectNodes(Node n, String xpath) throws JspTagException { >- >+ public List selectNodes(Node n, String xpath) throws JspTagException { >+ > staticInit(); > JstlVariableContext vs = new JstlVariableContext(); > XPathContext xpathSupport = new XPathContext(); >- xpathSupport.setVarStack( vs); >- >- Vector varVector = fillVarStack(vs, xpathSupport); >+ xpathSupport.setVarStack(vs); > >- Node contextNode = adaptParamsForXalan( vs, n, xpath.trim() ); >+ Vector varVector = fillVarStack(vs, xpathSupport); >+ >+ Node contextNode = adaptParamsForXalan(vs, n, xpath.trim()); > xpath = modifiedXPath; >- >- XObject result = JSTLXPathAPI.eval( contextNode, xpath, >- jstlPrefixResolver,xpathSupport, varVector); >+ >+ XObject result = JSTLXPathAPI.eval(contextNode, xpath, >+ jstlPrefixResolver, xpathSupport, varVector); > try { >- NodeList nl= JSTLXPathAPI.getNodeList(result); >- return new JSTLNodeList( nl ); >- } catch ( JspTagException e ) { >- try { >+ NodeList nl = JSTLXPathAPI.getNodeList(result); >+ return new JSTLNodeList(nl); >+ } catch (JspTagException e) { >+ try { > //If result can't be converted to NodeList we receive exception > // In this case we may have single primitive value as the result > // Populating List with this value ( String, Boolean or Number ) >@@ -547,154 +547,155 @@ > //System.out.println("JSTLXPathAPI.getNodeList thrown exception:"+ e); > Vector vector = new Vector(); > Object resultObject = null; >- if ( result.getType()== XObject.CLASS_BOOLEAN ) { >- resultObject = new Boolean( result.bool()); >- } else if ( result.getType()== XObject.CLASS_NUMBER ) { >- resultObject = new Double( result.num()); >- } else if ( result.getType()== XObject.CLASS_STRING ) { >+ if (result.getType() == XObject.CLASS_BOOLEAN) { >+ resultObject = result.bool(); >+ } else if (result.getType() == XObject.CLASS_NUMBER) { >+ resultObject = result.num(); >+ } else if (result.getType() == XObject.CLASS_STRING) { > resultObject = result.str(); > } > >- vector.add( resultObject ); >- return new JSTLNodeList ( vector ); >- } catch ( TransformerException te ) { >+ vector.add(resultObject); >+ return new JSTLNodeList(vector); >+ } catch (TransformerException te) { > throw new JspTagException(te.toString(), te); > } > } >- >- >- >+ >+ > } >- >- /** >- * Evaluate an XPath expression to a single node. >+ >+ /** >+ * Evaluate an XPath expression to a single node. > */ > public Node selectSingleNode(Node n, String xpath) >- throws JspTagException { >+ throws JspTagException { > //p("selectSingleNode of XPathUtil = passed node:" + > // "xpath => " + n + " : " + xpath ); >- >+ > staticInit(); > JstlVariableContext vs = new JstlVariableContext(); > XPathContext xpathSupport = new XPathContext(); >- xpathSupport.setVarStack( vs); >- >- Vector varVector = fillVarStack(vs, xpathSupport); >+ xpathSupport.setVarStack(vs); > >- Node contextNode = adaptParamsForXalan( vs, n, xpath.trim() ); >+ Vector varVector = fillVarStack(vs, xpathSupport); >+ >+ Node contextNode = adaptParamsForXalan(vs, n, xpath.trim()); > xpath = modifiedXPath; >- >- return (Node) JSTLXPathAPI.selectSingleNode( contextNode, xpath, >- jstlPrefixResolver,xpathSupport ); >+ >+ return (Node) JSTLXPathAPI.selectSingleNode(contextNode, xpath, >+ jstlPrefixResolver, xpathSupport); > } >- >- /** Returns a locally appropriate context given a node. */ >+ >+ /** >+ * Returns a locally appropriate context given a node. >+ */ > private VariableStack getLocalContext() { > // set up instance-specific contexts > VariableStack vc = new JstlVariableContext(); > return vc; >- } >- >+ } >+ > //********************************************************************* > // Adapt XPath expression for integration with Xalan >- >+ > /** >- * To evaluate an XPath expression using Xalan, we need >- * to create an XPath object, which wraps an expression object and provides >+ * To evaluate an XPath expression using Xalan, we need >+ * to create an XPath object, which wraps an expression object and provides > * general services for execution of that expression. >- * >+ * <p/> > * An XPath object can be instantiated with the following information: >- * - XPath expression to evaluate >- * - SourceLocator >- * (reports where an error occurred in the XML source or >- * transformation instructions) >- * - PrefixResolver >- * (resolve prefixes to namespace URIs) >- * - type >- * (one of SELECT or MATCH) >- * - ErrorListener >- * (customized error handling) >- * >+ * - XPath expression to evaluate >+ * - SourceLocator >+ * (reports where an error occurred in the XML source or >+ * transformation instructions) >+ * - PrefixResolver >+ * (resolve prefixes to namespace URIs) >+ * - type >+ * (one of SELECT or MATCH) >+ * - ErrorListener >+ * (customized error handling) >+ * <p/> > * Execution of the XPath expression represented by an XPath object > * is done via method execute which takes the following parameters: >- * - XPathContext >- * The execution context >- * - Node contextNode >- * The node that "." expresses >- * - PrefixResolver namespaceContext >- * The context in which namespaces in the XPath are supposed to be >- * expanded. >- * >+ * - XPathContext >+ * The execution context >+ * - Node contextNode >+ * The node that "." expresses >+ * - PrefixResolver namespaceContext >+ * The context in which namespaces in the XPath are supposed to be >+ * expanded. >+ * <p/> > * Given all of this, if no context node is set for the evaluation >- * of the XPath expression, one must be set so Xalan >+ * of the XPath expression, one must be set so Xalan > * can successfully evaluate a JSTL XPath expression. > * (it will not work if the context node is given as a varialbe > * at the beginning of the expression) > * > * @@@ Provide more details... > */ >- protected Node adaptParamsForXalan( JstlVariableContext jvc, Node n, >- String xpath ) { >+ protected Node adaptParamsForXalan(JstlVariableContext jvc, Node n, >+ String xpath) { > Node boundDocument = null; >- >+ > modifiedXPath = xpath; >- String origXPath = xpath ; >+ String origXPath = xpath; > boolean whetherOrigXPath = true; >- >+ > // If contextNode is not null then just pass the values to Xalan XPath > // unless this is an expression that starts off with an xml document >- if ( n != null && !xpath.startsWith("$") ) { >+ if (n != null && !xpath.startsWith("$")) { > return n; > } >- >- if ( xpath.startsWith("$") ) { >+ >+ if (xpath.startsWith("$")) { > // JSTL uses $scopePrefix:varLocalName/xpath expression > >- String varQName= xpath.substring( xpath.indexOf("$")+1); >- if ( varQName.indexOf("/") > 0 ) { >- varQName = varQName.substring( 0, varQName.indexOf("/")); >+ String varQName = xpath.substring(xpath.indexOf("$") + 1); >+ if (varQName.indexOf("/") > 0) { >+ varQName = varQName.substring(0, varQName.indexOf("/")); > } >- String varPrefix = null; >- String varLocalName = varQName; >- if ( varQName.indexOf( ":") >= 0 ) { >- varPrefix = varQName.substring( 0, varQName.indexOf(":") ); >- varLocalName = varQName.substring( varQName.indexOf(":")+1 ); >+ String varPrefix = null; >+ String varLocalName = varQName; >+ if (varQName.indexOf(":") >= 0) { >+ varPrefix = varQName.substring(0, varQName.indexOf(":")); >+ varLocalName = varQName.substring(varQName.indexOf(":") + 1); > } >- >- if ( xpath.indexOf("/") > 0 ) { >- xpath = xpath.substring( xpath.indexOf("/")); >- } else { >+ >+ if (xpath.indexOf("/") > 0) { >+ xpath = xpath.substring(xpath.indexOf("/")); >+ } else { > xpath = "/*"; >- whetherOrigXPath = false; >+ whetherOrigXPath = false; > } >- >- >+ >+ > try { >- Object varObject=jvc.getVariableValue( null,varPrefix, >- varLocalName); >+ Object varObject = jvc.getVariableValue(null, varPrefix, >+ varLocalName); > //System.out.println( "varObject => : its Class " +varObject + > // ":" + varObject.getClass() ); >- >- if ( Class.forName("org.w3c.dom.Document").isInstance( >- varObject ) ) { >+ >+ if (Class.forName("org.w3c.dom.Document").isInstance( >+ varObject)) { > //boundDocument = ((Document)varObject).getDocumentElement(); >- boundDocument = ((Document)varObject); >+ boundDocument = ((Document) varObject); > } else { >- >+ > //System.out.println("Creating a Dummy document to pass " + > // " onto as context node " ); >- >- if ( Class.forName("org.apache.taglibs.standard.tag.common.xml.JSTLNodeList").isInstance( varObject ) ) { >+ >+ if (Class.forName("org.apache.taglibs.standard.tag.common.xml.JSTLNodeList").isInstance(varObject)) { > Document newDocument = getDummyDocument(); > >- JSTLNodeList jstlNodeList = (JSTLNodeList)varObject; >- if ( jstlNodeList.getLength() == 1 ) { >- if ( Class.forName("org.w3c.dom.Node").isInstance( >- jstlNodeList.elementAt(0) ) ) { >- Node node = (Node)jstlNodeList.elementAt(0); >+ JSTLNodeList jstlNodeList = (JSTLNodeList) varObject; >+ if (jstlNodeList.getLength() == 1) { >+ if (Class.forName("org.w3c.dom.Node").isInstance( >+ jstlNodeList.elementAt(0))) { >+ Node node = (Node) jstlNodeList.elementAt(0); > boundDocument = getDocumentForNode(node); >- if ( whetherOrigXPath ) { >- xpath="/*" + xpath; >+ if (whetherOrigXPath) { >+ xpath = "/*" + xpath; > } > > } else { >@@ -709,20 +710,20 @@ > > //p("String value ( xpathwould be this) => " + xpath); > boundDocument = newDocument; >- } >- >+ } >+ > } else { > > Element dummyroot = newDocument.getDocumentElement(); >- for ( int i=0; i< jstlNodeList.getLength(); i++ ) { >- Node currNode = (Node)jstlNodeList.item(i); >- >+ for (int i = 0; i < jstlNodeList.getLength(); i++) { >+ Node currNode = (Node) jstlNodeList.item(i); >+ > Node importedNode = newDocument.importNode( >- currNode, true ); >+ currNode, true); > > //printDetails ( newDocument); > >- dummyroot.appendChild( importedNode ); >+ dummyroot.appendChild(importedNode); > > //p( "Details of the document After importing"); > //printDetails ( newDocument); >@@ -733,11 +734,11 @@ > // to change the xpath expression.Hopefully this > // won't change the result > >- xpath = "/*" + xpath; >+ xpath = "/*" + xpath; > } >- } else if ( Class.forName("org.w3c.dom.Node").isInstance( >- varObject ) ) { >- boundDocument = getDocumentForNode((Node)varObject); >+ } else if (Class.forName("org.w3c.dom.Node").isInstance( >+ varObject)) { >+ boundDocument = getDocumentForNode((Node) varObject); > if (whetherOrigXPath) { > xpath = "/*" + xpath; > } >@@ -745,147 +746,145 @@ > boundDocument = getDummyDocument(); > xpath = origXPath; > } >- >- >+ >+ > } >- } catch ( UnresolvableException ue ) { >+ } catch (UnresolvableException ue) { > // TODO: LOG > System.out.println("Variable Unresolvable :" + ue.getMessage()); > ue.printStackTrace(); >- } catch ( ClassNotFoundException cnf ) { >+ } catch (ClassNotFoundException cnf) { > // Will never happen > } >- } else { >+ } else { > //System.out.println("Not encountered $ Creating a Dummydocument 2 "+ >- // "pass onto as context node " ); >+ // "pass onto as context node " ); > boundDocument = getDummyDocument(); > } >- >+ > modifiedXPath = xpath; > //System.out.println("Modified XPath::boundDocument =>" + modifiedXPath + > // "::" + boundDocument ); >- >+ > return boundDocument; > } >- > >+ > //********************************************************************* > // >- >+ > /** >- ** @@@ why do we have to pass varVector in the varStack first, and then >+ * * @@@ why do we have to pass varVector in the varStack first, and then > * to XPath object? > */ >- private Vector fillVarStack(JstlVariableContext vs, XPathContext xpathSupport) >- throws JspTagException { >+ private Vector fillVarStack(JstlVariableContext vs, XPathContext xpathSupport) >+ throws JspTagException { > org.apache.xpath.VariableStack myvs = xpathSupport.getVarStack(); > Vector varVector = getVariableQNames(); >- for ( int i=0; i<varVector.size(); i++ ) { >- >- QName varQName = (QName)varVector.elementAt(i); >+ for (int i = 0; i < varVector.size(); i++) { > >- try { >- XObject variableValue = vs.getVariableOrParam( xpathSupport, varQName ); >+ QName varQName = (QName) varVector.elementAt(i); >+ >+ try { >+ XObject variableValue = vs.getVariableOrParam(xpathSupport, varQName); > //p("&&&&Variable set to => " + variableValue.toString() ); > //p("&&&&Variable type => " + variableValue.getTypeString() ); >- myvs.setGlobalVariable( i, variableValue ); >+ myvs.setGlobalVariable(i, variableValue); > >- } catch ( TransformerException te ) { >+ } catch (TransformerException te) { > throw new JspTagException(te.toString(), te); >- } >- >+ } >+ > } > return varVector; > } >- >- >- >- >- >+ >+ > //********************************************************************* > // Static support for context retrieval from parent <forEach> tag >- >+ > public static Node getContext(Tag t) throws JspTagException { > ForEachTag xt = >- (ForEachTag) TagSupport.findAncestorWithClass( >- t, ForEachTag.class); >- if (xt == null) >+ (ForEachTag) TagSupport.findAncestorWithClass( >+ t, ForEachTag.class); >+ if (xt == null) { > return null; >- else >+ } else { > return (xt.getContext()); >+ } > } >- >+ > //********************************************************************* > // Utility methods >- >+ > private static void p(String s) { > System.out.println("[XPathUtil] " + s); > } >- >+ > public static void printDetails(Node n) { >- System.out.println("\n\nDetails of Node = > " + n ) ; >+ System.out.println("\n\nDetails of Node = > " + n); > System.out.println("Name:Type:Node Value = > " + n.getNodeName() + >- ":" + n.getNodeType() + ":" + n.getNodeValue() ) ; >+ ":" + n.getNodeType() + ":" + n.getNodeValue()); > System.out.println("Namespace URI : Prefix : localName = > " + >- n.getNamespaceURI() + ":" +n.getPrefix() + ":" + n.getLocalName()); >- System.out.println("\n Node has children => " + n.hasChildNodes() ); >- if ( n.hasChildNodes() ) { >+ n.getNamespaceURI() + ":" + n.getPrefix() + ":" + n.getLocalName()); >+ System.out.println("\n Node has children => " + n.hasChildNodes()); >+ if (n.hasChildNodes()) { > NodeList nl = n.getChildNodes(); >- System.out.println("Number of Children => " + nl.getLength() ); >- for ( int i=0; i<nl.getLength(); i++ ) { >+ System.out.println("Number of Children => " + nl.getLength()); >+ for (int i = 0; i < nl.getLength(); i++) { > Node childNode = nl.item(i); >- printDetails( childNode ); >+ printDetails(childNode); > } > } >- } >+ } > } > >-class JSTLNodeList extends Vector implements NodeList { >- >+class JSTLNodeList extends Vector implements NodeList { >+ > Vector nodeVector; > >- public JSTLNodeList ( Vector nodeVector ) { >+ public JSTLNodeList(Vector nodeVector) { > this.nodeVector = nodeVector; > } > >- public JSTLNodeList ( NodeList nl ) { >+ public JSTLNodeList(NodeList nl) { > nodeVector = new Vector(); > //System.out.println("[JSTLNodeList] nodelist details"); >- for ( int i=0; i<nl.getLength(); i++ ) { >+ for (int i = 0; i < nl.getLength(); i++) { > Node currNode = nl.item(i); > //XPathUtil.printDetails ( currNode ); >- nodeVector.add(i, nl.item(i) ); >+ nodeVector.add(i, nl.item(i)); > } > } > >- public JSTLNodeList ( Node n ) { >+ public JSTLNodeList(Node n) { > nodeVector = new Vector(); >- nodeVector.addElement( n ); >+ nodeVector.addElement(n); > } >- > >- public Node item ( int index ) { >- return (Node)nodeVector.elementAt( index ); >+ >+ public Node item(int index) { >+ return (Node) nodeVector.elementAt(index); > } > > @Override >- public Object elementAt ( int index ) { >- return nodeVector.elementAt( index ); >+ public Object elementAt(int index) { >+ return nodeVector.elementAt(index); > } > > @Override >- public Object get ( int index ) { >- return nodeVector.get( index ); >+ public Object get(int index) { >+ return nodeVector.get(index); > } > >- public int getLength ( ) { >- return nodeVector.size( ); >+ public int getLength() { >+ return nodeVector.size(); > } > > @Override >- public int size ( ) { >+ public int size() { > //System.out.println("JSTL node list size => " + nodeVector.size() ); >- return nodeVector.size( ); >+ return nodeVector.size(); > } > > // Can implement other Vector methods to redirect those methods to >Index: src/main/java/org/apache/taglibs/standard/tag/common/xml/ForEachTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/xml/ForEachTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/xml/ForEachTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.xml; > >@@ -27,18 +27,18 @@ > /** > * <p>Support for the XML library's <forEach> tag.</p> > * >+ * @author Shawn Bayern > * @see javax.servlet.jsp.jstl.core.LoopTagSupport >- * @author Shawn Bayern > */ > public class ForEachTag extends LoopTagSupport { > > //********************************************************************* > // Private state > >- private String select; // tag attribute >- private List nodes; // XPath result >- private int nodesIndex; // current index >- private org.w3c.dom.Node current; // current node >+ private String select; // tag attribute >+ private List nodes; // XPath result >+ private int nodesIndex; // current index >+ private org.w3c.dom.Node current; // current node > > //********************************************************************* > // Iteration control methods >@@ -59,11 +59,12 @@ > > @Override > protected Object next() throws JspTagException { >- Object o = nodes.get(nodesIndex++); >- if (!(o instanceof org.w3c.dom.Node)) >- throw new JspTagException( >- Resources.getMessage("FOREACH_NOT_NODESET")); >- current = (org.w3c.dom.Node) o; >+ Object o = nodes.get(nodesIndex++); >+ if (!(o instanceof org.w3c.dom.Node)) { >+ throw new JspTagException( >+ Resources.getMessage("FOREACH_NOT_NODESET")); >+ } >+ current = (org.w3c.dom.Node) o; > return current; > } > >@@ -72,9 +73,10 @@ > // Tag logic and lifecycle management > > // Releases any resources we may have (or inherit) >+ > @Override > public void release() { >- init(); >+ init(); > super.release(); > } > >@@ -83,7 +85,7 @@ > // Attribute accessors > > public void setSelect(String select) { >- this.select = select; >+ this.select = select; > } > > public void setBegin(int begin) throws JspTagException { >@@ -103,13 +105,14 @@ > this.step = step; > validateStep(); > } >- >+ > //********************************************************************* > // Public methods for subtags > > /* Retrieves the current context. */ >+ > public org.w3c.dom.Node getContext() throws JspTagException { >- // expose the current node as the context >+ // expose the current node as the context > return current; > } > >@@ -118,10 +121,10 @@ > // Private utility methods > > private void init() { >- select = null; >- nodes = null; >- nodesIndex = 0; >- current = null; >- } >+ select = null; >+ nodes = null; >+ nodesIndex = 0; >+ current = null; >+ } > } > >Index: src/main/java/org/apache/taglibs/standard/tag/common/xml/ParseSupport.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/xml/ParseSupport.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/xml/ParseSupport.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.xml; > >@@ -60,15 +60,15 @@ > > protected Object xml; // 'xml' attribute > protected String systemId; // 'systemId' attribute >- protected XMLFilter filter; // 'filter' attribute >+ protected XMLFilter filter; // 'filter' attribute > > //********************************************************************* > // Private state > > private String var; // 'var' attribute >- private String varDom; // 'varDom' attribute >- private int scope; // processed 'scope' attr >- private int scopeDom; // processed 'scopeDom' attr >+ private String varDom; // 'varDom' attribute >+ private int scope; // processed 'scope' attr >+ private int scopeDom; // processed 'scopeDom' attr > > // state in support of XML parsing... > private DocumentBuilderFactory dbf; >@@ -81,21 +81,21 @@ > // Constructor and initialization > > public ParseSupport() { >- super(); >- init(); >+ super(); >+ init(); > } > > private void init() { >- var = varDom = null; >- xml = null; >- systemId = null; >- filter = null; >- dbf = null; >- db = null; >- tf = null; >- th = null; >- scope = PageContext.PAGE_SCOPE; >- scopeDom = PageContext.PAGE_SCOPE; >+ var = varDom = null; >+ xml = null; >+ systemId = null; >+ filter = null; >+ dbf = null; >+ db = null; >+ tf = null; >+ th = null; >+ scope = PageContext.PAGE_SCOPE; >+ scopeDom = PageContext.PAGE_SCOPE; > } > > >@@ -103,87 +103,97 @@ > // Tag logic > > // parse 'source' or body, storing result in 'var' >+ > @Override > public int doEndTag() throws JspException { >- try { >- >- // set up our DocumentBuilder >- if (dbf == null) { >- dbf = DocumentBuilderFactory.newInstance(); >- dbf.setNamespaceAware(true); >- dbf.setValidating(false); >- } >- db = dbf.newDocumentBuilder(); >+ try { > >- // if we've gotten a filter, set up a transformer to support it >- if (filter != null) { >- if (tf == null) >- tf = TransformerFactory.newInstance(); >- if (!tf.getFeature(SAXTransformerFactory.FEATURE)) >+ // set up our DocumentBuilder >+ if (dbf == null) { >+ dbf = DocumentBuilderFactory.newInstance(); >+ dbf.setNamespaceAware(true); >+ dbf.setValidating(false); >+ } >+ db = dbf.newDocumentBuilder(); >+ >+ // if we've gotten a filter, set up a transformer to support it >+ if (filter != null) { >+ if (tf == null) { >+ tf = TransformerFactory.newInstance(); >+ } >+ if (!tf.getFeature(SAXTransformerFactory.FEATURE)) { >+ throw new JspTagException( >+ Resources.getMessage("PARSE_NO_SAXTRANSFORMER")); >+ } >+ SAXTransformerFactory stf = (SAXTransformerFactory) tf; >+ th = stf.newTransformerHandler(); >+ } >+ >+ // produce a Document by parsing whatever the attributes tell us to use >+ Document d; >+ Object xmlText = this.xml; >+ if (xmlText == null) { >+ // if the attribute was specified, use the body as 'xml' >+ if (bodyContent != null && bodyContent.getString() != null) { >+ xmlText = bodyContent.getString().trim(); >+ } else { >+ xmlText = ""; >+ } >+ } >+ if (xmlText instanceof String) { >+ d = parseStringWithFilter((String) xmlText, filter); >+ } else if (xmlText instanceof Reader) { >+ d = parseReaderWithFilter((Reader) xmlText, filter); >+ } else { > throw new JspTagException( >- Resources.getMessage("PARSE_NO_SAXTRANSFORMER")); >- SAXTransformerFactory stf = (SAXTransformerFactory) tf; >- th = stf.newTransformerHandler(); >- } >+ Resources.getMessage("PARSE_INVALID_SOURCE")); >+ } > >- // produce a Document by parsing whatever the attributes tell us to use >- Document d; >- Object xmlText = this.xml; >- if (xmlText == null) { >- // if the attribute was specified, use the body as 'xml' >- if (bodyContent != null && bodyContent.getString() != null) >- xmlText = bodyContent.getString().trim(); >- else >- xmlText = ""; >- } >- if (xmlText instanceof String) >- d = parseStringWithFilter((String) xmlText, filter); >- else if (xmlText instanceof Reader) >- d = parseReaderWithFilter((Reader) xmlText, filter); >- else >- throw new JspTagException( >- Resources.getMessage("PARSE_INVALID_SOURCE")); >+ // we've got a Document object; store it out as appropriate >+ // (let any exclusivity or other constraints be enforced by TEI/TLV) >+ if (var != null) { >+ pageContext.setAttribute(var, d, scope); >+ } >+ if (varDom != null) { >+ pageContext.setAttribute(varDom, d, scopeDom); >+ } > >- // we've got a Document object; store it out as appropriate >- // (let any exclusivity or other constraints be enforced by TEI/TLV) >- if (var != null) >- pageContext.setAttribute(var, d, scope); >- if (varDom != null) >- pageContext.setAttribute(varDom, d, scopeDom); >- >- return EVAL_PAGE; >- } catch (SAXException ex) { >- throw new JspException(ex); >- } catch (IOException ex) { >- throw new JspException(ex); >- } catch (ParserConfigurationException ex) { >- throw new JspException(ex); >- } catch (TransformerConfigurationException ex) { >- throw new JspException(ex); >- } >+ return EVAL_PAGE; >+ } catch (SAXException ex) { >+ throw new JspException(ex); >+ } catch (IOException ex) { >+ throw new JspException(ex); >+ } catch (ParserConfigurationException ex) { >+ throw new JspException(ex); >+ } catch (TransformerConfigurationException ex) { >+ throw new JspException(ex); >+ } > } > > // Releases any resources we may have (or inherit) >+ > @Override > public void release() { >- init(); >+ init(); > } > > > //********************************************************************* > // Private utility methods > >- /** Parses the given InputSource after, applying the given XMLFilter. */ >+ /** >+ * Parses the given InputSource after, applying the given XMLFilter. >+ */ > private Document parseInputSourceWithFilter(InputSource s, XMLFilter f) > throws SAXException, IOException { >- if (f != null) { >+ if (f != null) { > // prepare an output Document > Document o = db.newDocument(); > > // use TrAX to adapt SAX events to a Document object > th.setResult(new DOMResult(o)); > XMLReader xr = XMLReaderFactory.createXMLReader(); >- xr.setEntityResolver(new JstlEntityResolver(pageContext)); >+ xr.setEntityResolver(new JstlEntityResolver(pageContext)); > // (note that we overwrite the filter's parent. this seems > // to be expected usage. we could cache and reset the old > // parent, but you can't setParent(null), so this wouldn't >@@ -192,107 +202,132 @@ > f.setContentHandler(th); > f.parse(s); > return o; >- } else >- return parseInputSource(s); >+ } else { >+ return parseInputSource(s); >+ } > } > >- /** Parses the given Reader after applying the given XMLFilter. */ >+ /** >+ * Parses the given Reader after applying the given XMLFilter. >+ */ > private Document parseReaderWithFilter(Reader r, XMLFilter f) > throws SAXException, IOException { >- return parseInputSourceWithFilter(new InputSource(r), f); >+ return parseInputSourceWithFilter(new InputSource(r), f); > } > >- /** Parses the given String after applying the given XMLFilter. */ >+ /** >+ * Parses the given String after applying the given XMLFilter. >+ */ > private Document parseStringWithFilter(String s, XMLFilter f) > throws SAXException, IOException { > StringReader r = new StringReader(s); > return parseReaderWithFilter(r, f); > } > >- /** Parses the given Reader after applying the given XMLFilter. */ >+ /** >+ * Parses the given Reader after applying the given XMLFilter. >+ */ > private Document parseURLWithFilter(String url, XMLFilter f) > throws SAXException, IOException { >- return parseInputSourceWithFilter(new InputSource(url), f); >+ return parseInputSourceWithFilter(new InputSource(url), f); > } > >- /** Parses the given InputSource into a Document. */ >+ /** >+ * Parses the given InputSource into a Document. >+ */ > private Document parseInputSource(InputSource s) >- throws SAXException, IOException { >- db.setEntityResolver(new JstlEntityResolver(pageContext)); >+ throws SAXException, IOException { >+ db.setEntityResolver(new JstlEntityResolver(pageContext)); > > // normalize URIs so they can be processed consistently by resolver >- if (systemId == null) >+ if (systemId == null) { > s.setSystemId("jstl:"); >- else if (ImportSupport.isAbsoluteUrl(systemId)) >+ } else if (ImportSupport.isAbsoluteUrl(systemId)) { > s.setSystemId(systemId); >- else >+ } else { > s.setSystemId("jstl:" + systemId); >- return db.parse(s); >+ } >+ return db.parse(s); > } > >- /** Parses the given Reader into a Document. */ >+ /** >+ * Parses the given Reader into a Document. >+ */ > private Document parseReader(Reader r) throws SAXException, IOException { > return parseInputSource(new InputSource(r)); > } > >- /** Parses the given String into a Document. */ >+ /** >+ * Parses the given String into a Document. >+ */ > private Document parseString(String s) throws SAXException, IOException { > StringReader r = new StringReader(s); > return parseReader(r); > } > >- /** Parses the URL (passed as a String) into a Document. */ >+ /** >+ * Parses the URL (passed as a String) into a Document. >+ */ > private Document parseURL(String url) throws SAXException, IOException { >- return parseInputSource(new InputSource(url)); >+ return parseInputSource(new InputSource(url)); > } > > //********************************************************************* > // JSTL-specific EntityResolver class > >- /** Lets us resolve relative external entities. */ >+ /** >+ * Lets us resolve relative external entities. >+ */ > public static class JstlEntityResolver implements EntityResolver { >- private final PageContext ctx; >+ private final PageContext ctx; >+ > public JstlEntityResolver(PageContext ctx) { > this.ctx = ctx; > } >+ > public InputSource resolveEntity(String publicId, String systemId) >- throws FileNotFoundException { >+ throws FileNotFoundException { > >- // pass if we don't have a systemId >- if (systemId == null) >- return null; >+ // pass if we don't have a systemId >+ if (systemId == null) { >+ return null; >+ } > >- // strip leading "jstl:" off URL if applicable >- if (systemId.startsWith("jstl:")) >- systemId = systemId.substring(5); >+ // strip leading "jstl:" off URL if applicable >+ if (systemId.startsWith("jstl:")) { >+ systemId = systemId.substring(5); >+ } > >- // we're only concerned with relative URLs >- if (ImportSupport.isAbsoluteUrl(systemId)) >- return null; >+ // we're only concerned with relative URLs >+ if (ImportSupport.isAbsoluteUrl(systemId)) { >+ return null; >+ } > >- // for relative URLs, load and wrap the resource. >- // don't bother checking for 'null' since we specifically want >- // the parser to fail if the resource doesn't exist >- InputStream s; >- if (systemId.startsWith("/")) { >- s = ctx.getServletContext().getResourceAsStream(systemId); >- if (s == null) >- throw new FileNotFoundException( >- Resources.getMessage("UNABLE_TO_RESOLVE_ENTITY", >- systemId)); >- } else { >- String pagePath = >- ((HttpServletRequest) ctx.getRequest()).getServletPath(); >- String basePath = >- pagePath.substring(0, pagePath.lastIndexOf("/")); >- s = ctx.getServletContext().getResourceAsStream( >- basePath + "/" + systemId); >- if (s == null) >- throw new FileNotFoundException( >- Resources.getMessage("UNABLE_TO_RESOLVE_ENTITY", >- systemId)); >- } >- return new InputSource(s); >+ // for relative URLs, load and wrap the resource. >+ // don't bother checking for 'null' since we specifically want >+ // the parser to fail if the resource doesn't exist >+ InputStream s; >+ if (systemId.startsWith("/")) { >+ s = ctx.getServletContext().getResourceAsStream(systemId); >+ if (s == null) { >+ throw new FileNotFoundException( >+ Resources.getMessage("UNABLE_TO_RESOLVE_ENTITY", >+ systemId)); >+ } >+ } else { >+ String pagePath = >+ ((HttpServletRequest) ctx.getRequest()).getServletPath(); >+ String basePath = >+ pagePath.substring(0, pagePath.lastIndexOf("/")); >+ s = ctx.getServletContext().getResourceAsStream( >+ basePath + "/" + systemId); >+ if (s == null) { >+ throw new FileNotFoundException( >+ Resources.getMessage("UNABLE_TO_RESOLVE_ENTITY", >+ systemId)); >+ } >+ } >+ return new InputSource(s); > } > } > >@@ -300,18 +335,18 @@ > // Tag attributes > > public void setVar(String var) { >- this.var = var; >+ this.var = var; > } > > public void setVarDom(String varDom) { >- this.varDom = varDom; >+ this.varDom = varDom; > } > > public void setScope(String scope) { >- this.scope = Util.getScope(scope); >+ this.scope = Util.getScope(scope); > } > > public void setScopeDom(String scopeDom) { >- this.scopeDom = Util.getScope(scopeDom); >+ this.scopeDom = Util.getScope(scopeDom); > } > } >Index: src/main/java/org/apache/taglibs/standard/tag/common/xml/SetTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/xml/SetTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/xml/SetTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.xml; > >@@ -37,7 +37,7 @@ > > private String select; // tag attribute > private String var; // tag attribute >- private int scope; // processed tag attribute >+ private int scope; // processed tag attribute > > //********************************************************************* > // Construction and initialization >@@ -53,9 +53,10 @@ > } > > // resets local state >+ > private void init() { >- var = null; >- select = null; >+ var = null; >+ select = null; > scope = PageContext.PAGE_SCOPE; > } > >@@ -64,28 +65,31 @@ > // Tag logic > > // applies XPath expression from 'select' and stores the result in 'var' >+ > @Override > public int doStartTag() throws JspException { > // process the query > XPathUtil xu = new XPathUtil(pageContext); > List result = >- xu.selectNodes(XPathUtil.getContext(this), select); >+ xu.selectNodes(XPathUtil.getContext(this), select); > Object ret = result; >- >+ > // unwrap primitive types if that's what we received > if (result.size() == 1) { > Object o = result.get(0); > if (o instanceof String || o instanceof Boolean >- || o instanceof Number) >+ || o instanceof Number) { > ret = o; >+ } > } >- >+ > // expose the final result > pageContext.setAttribute(var, ret, scope); > return SKIP_BODY; > } > > // Releases any resources we may have (or inherit) >+ > @Override > public void release() { > super.release(); >@@ -97,14 +101,14 @@ > // Attribute accessors > > public void setSelect(String select) { >- this.select = select; >+ this.select = select; > } > > public void setVar(String var) { >- this.var = var; >+ this.var = var; > } > > public void setScope(String scope) { >- this.scope = Util.getScope(scope); >+ this.scope = Util.getScope(scope); > } > } >Index: src/main/java/org/apache/taglibs/standard/tag/common/xml/TransformSupport.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/xml/TransformSupport.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/xml/TransformSupport.java (working copy) >@@ -23,6 +23,7 @@ > import java.io.StringReader; > import java.io.Writer; > import java.util.List; >+ > import javax.servlet.http.HttpServletRequest; > import javax.servlet.jsp.JspException; > import javax.servlet.jsp.JspTagException; >@@ -130,9 +131,10 @@ > > // we can assume at most one of 'var' or 'result' is specified > if (result != null) >- // we can write directly to the Result >+ // we can write directly to the Result >+ { > t.transform(source, result); >- else if (var != null) { >+ } else if (var != null) { > // we need a Document > Document d = db.newDocument(); > Result doc = new DOMResult(d); >@@ -183,12 +185,13 @@ > * the current directory in the filesystem. > */ > private static String wrapSystemId(String systemId) { >- if (systemId == null) >+ if (systemId == null) { > return "jstl:"; >- else if (ImportSupport.isAbsoluteUrl(systemId)) >+ } else if (ImportSupport.isAbsoluteUrl(systemId)) { > return systemId; >- else >+ } else { > return ("jstl:" + systemId); >+ } > } > > /** >@@ -271,6 +274,7 @@ > > /** > * Return the Source for a document specified as body content. >+ * > * @return the document Source > * @throws JspTagException if there is a problem with the body content > */ >@@ -373,8 +377,9 @@ > throws TransformerException { > > // pass if we don't have a systemId >- if (href == null) >+ if (href == null) { > return null; >+ } > > // remove "jstl" marker from 'base' > // NOTE: how 'base' is determined varies among different Xalan >@@ -386,14 +391,16 @@ > > // we're only concerned with relative URLs > if (ImportSupport.isAbsoluteUrl(href) >- || (base != null && ImportSupport.isAbsoluteUrl(base))) >+ || (base != null && ImportSupport.isAbsoluteUrl(base))) { > return null; >+ } > > // base is relative; remove everything after trailing '/' >- if (base == null || base.lastIndexOf("/") == -1) >+ if (base == null || base.lastIndexOf("/") == -1) { > base = ""; >- else >+ } else { > base = base.substring(0, base.lastIndexOf("/") + 1); >+ } > > // concatenate to produce the real URL we're interested in > String target = base + href; >@@ -404,10 +411,11 @@ > InputStream s; > if (target.startsWith("/")) { > s = ctx.getServletContext().getResourceAsStream(target); >- if (s == null) >+ if (s == null) { > throw new TransformerException( > Resources.getMessage("UNABLE_TO_RESOLVE_ENTITY", > href)); >+ } > } else { > String pagePath = > ((HttpServletRequest) ctx.getRequest()).getServletPath(); >@@ -415,10 +423,11 @@ > pagePath.substring(0, pagePath.lastIndexOf("/")); > s = ctx.getServletContext().getResourceAsStream( > basePath + "/" + target); >- if (s == null) >+ if (s == null) { > throw new TransformerException( > Resources.getMessage("UNABLE_TO_RESOLVE_ENTITY", > href)); >+ } > } > return new StreamSource(s); > } >Index: src/main/java/org/apache/taglibs/standard/tag/common/xml/IfTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/xml/IfTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/xml/IfTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.xml; > >@@ -32,12 +32,14 @@ > // Constructor and lifecycle management > > // initialize inherited and local state >+ > public IfTag() { > super(); > init(); > } > > // Releases any resources we may have (or inherit) >+ > @Override > public void release() { > super.release(); >@@ -73,6 +75,7 @@ > // Private utility methods > > // resets internal state >+ > private void init() { > select = null; > } >Index: src/main/java/org/apache/taglibs/standard/tag/common/xml/ExprSupport.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/xml/ExprSupport.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/xml/ExprSupport.java (working copy) >@@ -13,19 +13,19 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.xml; > >-import org.apache.taglibs.standard.util.EscapeXML; >- > import javax.servlet.jsp.JspException; > import javax.servlet.jsp.JspTagException; > import javax.servlet.jsp.tagext.TagSupport; > >+import org.apache.taglibs.standard.util.EscapeXML; >+ > /** > * <p>Tag handler for <out> in JSTL's XML library.</p> >- * >+ * <p/> > * TODO: should we rename this to OutSupport to match the tag name? > * > * @author Shawn Bayern >@@ -37,7 +37,7 @@ > // Internal state > > private String select; // tag attribute >- protected boolean escapeXml; // tag attribute >+ protected boolean escapeXml; // tag attribute > > //********************************************************************* > // Construction and initialization >@@ -53,8 +53,9 @@ > } > > // resets local state >+ > private void init() { >- select = null; >+ select = null; > escapeXml = true; > } > >@@ -63,19 +64,21 @@ > // Tag logic > > // applies XPath expression from 'select' and prints the result >+ > @Override > public int doStartTag() throws JspException { > try { > XPathUtil xu = new XPathUtil(pageContext); > String result = xu.valueOf(XPathUtil.getContext(this), select); > EscapeXML.emit(result, escapeXml, pageContext.getOut()); >- return SKIP_BODY; >+ return SKIP_BODY; > } catch (java.io.IOException ex) { > throw new JspTagException(ex.toString(), ex); > } > } > > // Releases any resources we may have (or inherit) >+ > @Override > public void release() { > super.release(); >@@ -87,6 +90,6 @@ > // Attribute accessors > > public void setSelect(String select) { >- this.select = select; >+ this.select = select; > } > } >Index: src/main/java/org/apache/taglibs/standard/tag/common/xml/JSTLXPathAPI.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/xml/JSTLXPathAPI.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/xml/JSTLXPathAPI.java (working copy) >@@ -39,7 +39,7 @@ > * created for each evaluation. A faster way is to precompile the > * XPaths using the low-level API, and then just use the XPaths > * over and over. >- * >+ * <p/> > * NOTE: In particular, each call to this method will create a new > * XPathContext, a new DTMManager... and thus a new DTM. That's very > * safe, since it guarantees that you're always processing against a >@@ -49,198 +49,191 @@ > * methods. > * > * @see <a href="http://www.w3.org/TR/xpath">XPath Specification</a> >- * > */ >-public class JSTLXPathAPI extends XPathAPI { >+public class JSTLXPathAPI extends XPathAPI { > /** > * Use an XPath string to select a single node. > * XPath namespace prefixes are resolved using the prefixResolver. > * >- * @param contextNode The node to start searching from. >- * @param str A valid XPath string. >+ * @param contextNode The node to start searching from. >+ * @param str A valid XPath string. > * @param prefixResolver The PrefixResolver using which prefixes in the XPath will be resolved to namespaces. > * @return The first node found that matches the XPath, or null. >- * > * @throws JspTagException > */ > public static Node selectSingleNode( >- Node contextNode, String str, PrefixResolver prefixResolver) >- throws JspTagException { >- >+ Node contextNode, String str, PrefixResolver prefixResolver) >+ throws JspTagException { >+ > // Have the XObject return its result as a NodeSetDTM. > NodeIterator nl = selectNodeIterator(contextNode, str, prefixResolver); >- >+ > // Return the first node, or null > return nl.nextNode(); > } >- >+ > /** > * Use an XPath string to select a single node. > * XPath namespace prefixes are resolved using the prefixResolver. > * >- * @param contextNode The node to start searching from. >- * @param str A valid XPath string. >+ * @param contextNode The node to start searching from. >+ * @param str A valid XPath string. > * @param prefixResolver The PrefixResolver using which prefixes in the XPath will be resolved to namespaces. > * @return The first node found that matches the XPath, or null. >- * > * @throws JspTagException > */ > public static Node selectSingleNode( >- Node contextNode, String str, PrefixResolver prefixResolver, >- XPathContext xpathSupport ) throws JspTagException { >- >+ Node contextNode, String str, PrefixResolver prefixResolver, >+ XPathContext xpathSupport) throws JspTagException { >+ > // Have the XObject return its result as a NodeSetDTM. > NodeIterator nl = selectNodeIterator(contextNode, str, prefixResolver, xpathSupport); >- >+ > // Return the first node, or null > return nl.nextNode(); > } >- >+ > /** >- * Use an XPath string to select a nodelist. >- * XPath namespace prefixes are resolved using PrefixResolver. >+ * Use an XPath string to select a nodelist. >+ * XPath namespace prefixes are resolved using PrefixResolver. > * >- * @param contextNode The node to start searching from. >- * @param str A valid XPath string. >- * @param prefixResolver The PrefixResolver using which prefixes in the XPath will be resolved to namespaces. >- * @return A NodeIterator, should never be null. >- * >+ * @param contextNode The node to start searching from. >+ * @param str A valid XPath string. >+ * @param prefixResolver The PrefixResolver using which prefixes in the XPath will be resolved to namespaces. >+ * @return A NodeIterator, should never be null. > * @throws JspTagException > */ > public static NodeIterator selectNodeIterator( >- Node contextNode, String str, PrefixResolver prefixResolver) >- throws JspTagException { >- >+ Node contextNode, String str, PrefixResolver prefixResolver) >+ throws JspTagException { >+ > // Execute the XPath, and have it return the result > XObject list = eval(contextNode, str, prefixResolver, null); >- >+ > // Have the XObject return its result as a NodeSetDTM. > return getNodeIterator(list); > } >- >+ > /** >- * Use an XPath string to select a nodelist. >- * XPath namespace prefixes are resolved using PrefixResolver. >+ * Use an XPath string to select a nodelist. >+ * XPath namespace prefixes are resolved using PrefixResolver. > * >- * @param contextNode The node to start searching from. >- * @param str A valid XPath string. >- * @param prefixResolver The PrefixResolver using which prefixes in the XPath will be resolved to namespaces. >- * @return A NodeIterator, should never be null. >- * >+ * @param contextNode The node to start searching from. >+ * @param str A valid XPath string. >+ * @param prefixResolver The PrefixResolver using which prefixes in the XPath will be resolved to namespaces. >+ * @return A NodeIterator, should never be null. > * @throws JspTagException > */ > public static NodeIterator selectNodeIterator( >- Node contextNode, String str, PrefixResolver prefixResolver, >- XPathContext xpathSupport ) throws JspTagException { >- >+ Node contextNode, String str, PrefixResolver prefixResolver, >+ XPathContext xpathSupport) throws JspTagException { >+ > // Execute the XPath, and have it return the result > XObject list = eval(contextNode, str, prefixResolver, xpathSupport); >- >+ > // Have the XObject return its result as a NodeSetDTM. > return getNodeIterator(list); > } >- >+ > /** >- * Use an XPath string to select a nodelist. >- * XPath namespace prefixes are resolved using the prefixResolver. >+ * Use an XPath string to select a nodelist. >+ * XPath namespace prefixes are resolved using the prefixResolver. > * >- * @param contextNode The node to start searching from. >- * @param str A valid XPath string. >- * @param prefixResolver The PrefixResolver using which prefixes in the XPath will be resolved to namespaces. >- * @return A NodeIterator, should never be null. >- * >+ * @param contextNode The node to start searching from. >+ * @param str A valid XPath string. >+ * @param prefixResolver The PrefixResolver using which prefixes in the XPath will be resolved to namespaces. >+ * @return A NodeIterator, should never be null. > * @throws JspTagException > */ > private static NodeList selectNodeList( >- Node contextNode, String str, PrefixResolver prefixResolver) >- throws JspTagException { >+ Node contextNode, String str, PrefixResolver prefixResolver) >+ throws JspTagException { > // Execute the XPath, and have it return the result > XObject list = eval(contextNode, str, prefixResolver, null); >- >+ > // Return a NodeList. > return getNodeList(list); > } >- >+ > /** >- * Use an XPath string to select a nodelist. >- * XPath namespace prefixes are resolved using the prefixResolver. >+ * Use an XPath string to select a nodelist. >+ * XPath namespace prefixes are resolved using the prefixResolver. > * >- * @param contextNode The node to start searching from. >- * @param str A valid XPath string. >- * @param prefixResolver The PrefixResolver using which prefixes in the XPath will be resolved to namespaces. >- * @return A NodeIterator, should never be null. >- * >+ * @param contextNode The node to start searching from. >+ * @param str A valid XPath string. >+ * @param prefixResolver The PrefixResolver using which prefixes in the XPath will be resolved to namespaces. >+ * @return A NodeIterator, should never be null. > * @throws JspTagException > */ > public static NodeList selectNodeList( >- Node contextNode, String str, PrefixResolver prefixResolver, >- XPathContext xpathSupport ) >- throws JspTagException >- { >+ Node contextNode, String str, PrefixResolver prefixResolver, >+ XPathContext xpathSupport) >+ throws JspTagException { > // Execute the XPath, and have it return the result > XObject list = eval(contextNode, str, prefixResolver, xpathSupport); >- >+ > // Return a NodeList. > return getNodeList(list); > } >- >+ > /** > * Returns a NodeIterator from an XObject. >- * @param list The XObject from which a NodeIterator is returned. >- * @return A NodeIterator, should never be null. >- * @throws JspTagException >+ * >+ * @param list The XObject from which a NodeIterator is returned. >+ * @return A NodeIterator, should never be null. >+ * @throws JspTagException > */ >- private static NodeIterator getNodeIterator(XObject list) >- throws JspTagException { >+ private static NodeIterator getNodeIterator(XObject list) >+ throws JspTagException { > try { > return list.nodeset(); > } catch (TransformerException ex) { > throw new JspTagException( >- Resources.getMessage("XPATH_ERROR_XOBJECT", ex.toString()), ex); >+ Resources.getMessage("XPATH_ERROR_XOBJECT", ex.toString()), ex); > } >- } >+ } > > /** > * Returns a NodeList from an XObject. >- * @param list The XObject from which a NodeList is returned. >- * @return A NodeList, should never be null. >- * @throws JspTagException >+ * >+ * @param list The XObject from which a NodeList is returned. >+ * @return A NodeList, should never be null. >+ * @throws JspTagException > */ >- static NodeList getNodeList(XObject list) >- throws JspTagException { >+ static NodeList getNodeList(XObject list) >+ throws JspTagException { > try { > return list.nodelist(); > } catch (TransformerException ex) { > throw new JspTagException( >- Resources.getMessage("XPATH_ERROR_XOBJECT", ex.toString()), ex); >+ Resources.getMessage("XPATH_ERROR_XOBJECT", ex.toString()), ex); > } >- } >- >+ } >+ > /** >- * Evaluate XPath string to an XObject. >- * XPath namespace prefixes are resolved from the namespaceNode. >- * The implementation of this is a little slow, since it creates >- * a number of objects each time it is called. This could be optimized >- * to keep the same objects around, but then thread-safety issues would arise. >+ * Evaluate XPath string to an XObject. >+ * XPath namespace prefixes are resolved from the namespaceNode. >+ * The implementation of this is a little slow, since it creates >+ * a number of objects each time it is called. This could be optimized >+ * to keep the same objects around, but then thread-safety issues would arise. > * >- * @param contextNode The node to start searching from. >- * @param str A valid XPath string. >- * @param xpathSupport The node from which prefixes in the XPath will be resolved to namespaces. >- * @param prefixResolver Will be called if the parser encounters namespace >- * prefixes, to resolve the prefixes to URLs. >- * @return An XObject, which can be used to obtain a string, number, nodelist, etc, should never be null. >- * @see org.apache.xpath.objects.XObject >- * @see org.apache.xpath.objects.XNull >- * @see org.apache.xpath.objects.XBoolean >- * @see org.apache.xpath.objects.XNumber >- * @see org.apache.xpath.objects.XString >- * @see org.apache.xpath.objects.XRTreeFrag >- * >+ * @param contextNode The node to start searching from. >+ * @param str A valid XPath string. >+ * @param xpathSupport The node from which prefixes in the XPath will be resolved to namespaces. >+ * @param prefixResolver Will be called if the parser encounters namespace >+ * prefixes, to resolve the prefixes to URLs. >+ * @return An XObject, which can be used to obtain a string, number, nodelist, etc, should never be null. > * @throws JspTagException >+ * @see org.apache.xpath.objects.XObject >+ * @see org.apache.xpath.objects.XNull >+ * @see org.apache.xpath.objects.XBoolean >+ * @see org.apache.xpath.objects.XNumber >+ * @see org.apache.xpath.objects.XString >+ * @see org.apache.xpath.objects.XRTreeFrag > */ > public static XObject eval( >- Node contextNode, String str, PrefixResolver prefixResolver, >- XPathContext xpathSupport) throws JspTagException { >+ Node contextNode, String str, PrefixResolver prefixResolver, >+ XPathContext xpathSupport) throws JspTagException { > //System.out.println("eval of XPathContext params: contextNode:str(xpath)"+ > // ":prefixResolver:xpathSupport => " + contextNode + ":" + str + ":" + > // prefixResolver + ":" + xpathSupport ); >@@ -248,7 +241,7 @@ > if (xpathSupport == null) { > return eval(contextNode, str, prefixResolver); > } >- >+ > // Since we don't have a XML Parser involved here, install some default support > // for things like namespaces, etc. > // (Changed from: XPathContext xpathSupport = new XPathContext(); >@@ -256,25 +249,25 @@ > // XPathContext should be done away with.) > // Create the XPath object. > XPath xpath = new XPath(str, null, prefixResolver, XPath.SELECT, null); >- >+ > // Execute the XPath, and have it return the result > int ctxtNode = xpathSupport.getDTMHandleFromNode(contextNode); >- >+ > // System.out.println("Context Node id ( after getDTMHandlerFromNode) => " + ctxtNode ); > XObject xobj = xpath.execute(xpathSupport, ctxtNode, prefixResolver); > return xobj; > } catch (TransformerException ex) { > throw new JspTagException( >- Resources.getMessage("XPATH_ERROR_EVALUATING_EXPR", str, ex.toString()), ex); >+ Resources.getMessage("XPATH_ERROR_EVALUATING_EXPR", str, ex.toString()), ex); > } catch (IllegalArgumentException ex) { > throw new JspTagException( >- Resources.getMessage("XPATH_ILLEGAL_ARG_EVALUATING_EXPR", str, ex.toString()), ex); >+ Resources.getMessage("XPATH_ILLEGAL_ARG_EVALUATING_EXPR", str, ex.toString()), ex); > } > } >- >+ > public static XObject eval( >- Node contextNode, String str, PrefixResolver prefixResolver, >- XPathContext xpathSupport, Vector varQNames) throws JspTagException { >+ Node contextNode, String str, PrefixResolver prefixResolver, >+ XPathContext xpathSupport, Vector varQNames) throws JspTagException { > //p("***************** eval "); > //p( "contextNode => " + contextNode ); > //p( "XPath str => " + str ); >@@ -283,22 +276,22 @@ > //p( "Var QNames => " + varQNames ); > //p( "Global Var Size => " + varQNames.size() ); > try { >- XPath xpath = new XPath(str, null, prefixResolver, XPath.SELECT, null); >- xpath.fixupVariables( varQNames, varQNames.size()); >+ XPath xpath = new XPath(str, null, prefixResolver, XPath.SELECT, null); >+ xpath.fixupVariables(varQNames, varQNames.size()); > // Execute the XPath, and have it return the result >- int ctxtNode = xpathSupport.getDTMHandleFromNode(contextNode); >+ int ctxtNode = xpathSupport.getDTMHandleFromNode(contextNode); > // System.out.println("Context Node id ( after getDTMHandlerFromNode) => " + ctxtNode ); > return xpath.execute(xpathSupport, ctxtNode, prefixResolver); > } catch (TransformerException ex) { > throw new JspTagException( >- Resources.getMessage("XPATH_ERROR_EVALUATING_EXPR", str, ex.toString()), ex); >+ Resources.getMessage("XPATH_ERROR_EVALUATING_EXPR", str, ex.toString()), ex); > } catch (IllegalArgumentException ex) { > throw new JspTagException( >- Resources.getMessage("XPATH_ILLEGAL_ARG_EVALUATING_EXPR", str, ex.toString()), ex); >+ Resources.getMessage("XPATH_ILLEGAL_ARG_EVALUATING_EXPR", str, ex.toString()), ex); > } >- } >- >+ } >+ > private static void p(String s) { > System.out.println("[JSTLXPathAPI] " + s); >- } >+ } > } >Index: src/main/java/org/apache/taglibs/standard/tag/common/xml/JSTLPrefixResolver.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/xml/JSTLPrefixResolver.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/xml/JSTLPrefixResolver.java (working copy) >@@ -28,127 +28,118 @@ > * can be used to perform prefix-to-namespace lookup > * for the XPath object. > */ >-public class JSTLPrefixResolver implements PrefixResolver >-{ >+public class JSTLPrefixResolver implements PrefixResolver { > >- /** >- * The context to resolve the prefix from, if the context >- * is not given. */ >+ /** >+ * The context to resolve the prefix from, if the context >+ * is not given. >+ */ > > HashMap namespaces; > >- /** >- * The URI for the XML namespace. >- * (Duplicate of that found in org.apache.xpath.XPathContext). */ >- >- public static final String S_XMLNAMESPACEURI = >- "http://www.w3.org/XML/1998/namespace"; >+ /** >+ * The URI for the XML namespace. >+ * (Duplicate of that found in org.apache.xpath.XPathContext). >+ */ > >- /** >- * No-arg constructor which would create empty HashMap of namespaces >- */ >- public JSTLPrefixResolver() >- { >- namespaces = new HashMap(); >- } >+ public static final String S_XMLNAMESPACEURI = >+ "http://www.w3.org/XML/1998/namespace"; > >- public JSTLPrefixResolver( HashMap nses ) >- { >- namespaces = nses; >- } >+ /** >+ * No-arg constructor which would create empty HashMap of namespaces >+ */ >+ public JSTLPrefixResolver() { >+ namespaces = new HashMap(); >+ } > >- /** >- * Given a namespace, get the corresponding prefix. This assumes that >- * the PrevixResolver hold's it's own namespace context, or is a namespace >- * context itself. >- * @param prefix Prefix to resolve. >- * @return Namespace that prefix resolves to, or null if prefix >- * is not bound. >- */ >- public String getNamespaceForPrefix(String prefix) >- { >- return (String)namespaces.get(prefix); >- } >+ public JSTLPrefixResolver(HashMap nses) { >+ namespaces = nses; >+ } > >- /** >- * Given a prefix and a Context Node, get the corresponding namespace. >- * Warning: This will not work correctly if namespaceContext >- * is an attribute node. >- * @param prefix Prefix to resolve. >- * @param namespaceContext Node from which to start searching for a >- * xmlns attribute that binds a prefix to a namespace. >- * @return Namespace that prefix resolves to, or null if prefix >- * is not bound. >- */ >- public String getNamespaceForPrefix(String prefix, >- org.w3c.dom.Node namespaceContext) >- { >+ /** >+ * Given a namespace, get the corresponding prefix. This assumes that >+ * the PrevixResolver hold's it's own namespace context, or is a namespace >+ * context itself. >+ * >+ * @param prefix Prefix to resolve. >+ * @return Namespace that prefix resolves to, or null if prefix >+ * is not bound. >+ */ >+ public String getNamespaceForPrefix(String prefix) { >+ return (String) namespaces.get(prefix); >+ } > >- Node parent = namespaceContext; >- String namespace = null; >+ /** >+ * Given a prefix and a Context Node, get the corresponding namespace. >+ * Warning: This will not work correctly if namespaceContext >+ * is an attribute node. >+ * >+ * @param prefix Prefix to resolve. >+ * @param namespaceContext Node from which to start searching for a >+ * xmlns attribute that binds a prefix to a namespace. >+ * @return Namespace that prefix resolves to, or null if prefix >+ * is not bound. >+ */ >+ public String getNamespaceForPrefix(String prefix, >+ org.w3c.dom.Node namespaceContext) { > >- if (prefix.equals("xml")) >- { >- namespace = S_XMLNAMESPACEURI; >- } >- else >- { >- int type; >+ Node parent = namespaceContext; >+ String namespace = null; > >- while ((null != parent) && (null == namespace) >- && (((type = parent.getNodeType()) == Node.ELEMENT_NODE) >- || (type == Node.ENTITY_REFERENCE_NODE))) >- { >- if (type == Node.ELEMENT_NODE) >- { >- NamedNodeMap nnm = parent.getAttributes(); >+ if (prefix.equals("xml")) { >+ namespace = S_XMLNAMESPACEURI; >+ } else { >+ int type; > >- for (int i = 0; i < nnm.getLength(); i++) >- { >- Node attr = nnm.item(i); >- String aname = attr.getNodeName(); >- boolean isPrefix = aname.startsWith("xmlns:"); >+ while ((null != parent) && (null == namespace) >+ && (((type = parent.getNodeType()) == Node.ELEMENT_NODE) >+ || (type == Node.ENTITY_REFERENCE_NODE))) { >+ if (type == Node.ELEMENT_NODE) { >+ NamedNodeMap nnm = parent.getAttributes(); > >- if (isPrefix || aname.equals("xmlns")) >- { >- int index = aname.indexOf(':'); >- String p = isPrefix ? aname.substring(index + 1) : ""; >+ for (int i = 0; i < nnm.getLength(); i++) { >+ Node attr = nnm.item(i); >+ String aname = attr.getNodeName(); >+ boolean isPrefix = aname.startsWith("xmlns:"); > >- if (p.equals(prefix)) >- { >- namespace = attr.getNodeValue(); >+ if (isPrefix || aname.equals("xmlns")) { >+ int index = aname.indexOf(':'); >+ String p = isPrefix ? aname.substring(index + 1) : ""; > >- break; >- } >+ if (p.equals(prefix)) { >+ namespace = attr.getNodeValue(); >+ >+ break; >+ } >+ } >+ } >+ } >+ >+ parent = parent.getParentNode(); > } >- } > } > >- parent = parent.getParentNode(); >- } >+ return namespace; > } > >- return namespace; >- } >+ /** >+ * Return the base identifier. >+ * >+ * @return null >+ */ >+ public String getBaseIdentifier() { >+ return null; >+ } > >- /** >- * Return the base identifier. >- * >- * @return null >- */ >- public String getBaseIdentifier() >- { >- return null; >- } >+ /** >+ * @see PrefixResolver#handlesNullPrefixes() >+ */ >+ public boolean handlesNullPrefixes() { >+ return false; >+ } > >- /** >- * @see PrefixResolver#handlesNullPrefixes() */ >- public boolean handlesNullPrefixes() { >- return false; >- } >+ public void addNamespace(String prefix, String uri) { >+ namespaces.put(prefix, uri); >+ } > >- public void addNamespace ( String prefix, String uri ) { >- namespaces.put( prefix, uri ); >- } >- > } >Index: src/main/java/org/apache/taglibs/standard/tag/common/xml/ParamSupport.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/xml/ParamSupport.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/xml/ParamSupport.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.xml; > >@@ -28,8 +28,8 @@ > * <p>Support for tag handlers for <param>, the XML parameter > * subtag for <transformt<.</p> > * >+ * @author Shawn Bayern > * @see TransformSupport >- * @author Shawn Bayern > */ > > public abstract class ParamSupport extends BodyTagSupport { >@@ -44,13 +44,13 @@ > // Constructor and initialization > > public ParamSupport() { >- super(); >- init(); >+ super(); >+ init(); > } > > private void init() { >- name = null; >- value = null; >+ name = null; >+ value = null; > } > > >@@ -58,28 +58,32 @@ > // Tag logic > > // simply send our name and value to our parent <transform> tag >+ > @Override > public int doEndTag() throws JspException { >- Tag t = findAncestorWithClass(this, TransformSupport.class); >- if (t == null) >- throw new JspTagException( >- Resources.getMessage("PARAM_OUTSIDE_TRANSFORM")); >- TransformSupport parent = (TransformSupport) t; >+ Tag t = findAncestorWithClass(this, TransformSupport.class); >+ if (t == null) { >+ throw new JspTagException( >+ Resources.getMessage("PARAM_OUTSIDE_TRANSFORM")); >+ } >+ TransformSupport parent = (TransformSupport) t; > >- Object value = this.value; >- if (value == null) { >- if (bodyContent == null || bodyContent.getString() == null) >+ Object value = this.value; >+ if (value == null) { >+ if (bodyContent == null || bodyContent.getString() == null) { > value = ""; >- else >+ } else { > value = bodyContent.getString().trim(); >+ } > } >- parent.addParameter(name, value); >- return EVAL_PAGE; >+ parent.addParameter(name, value); >+ return EVAL_PAGE; > } > > // Releases any resources we may have (or inherit) >+ > @Override > public void release() { >- init(); >+ init(); > } > } >Index: src/main/java/org/apache/taglibs/standard/tag/common/xml/WhenTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/xml/WhenTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/xml/WhenTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.xml; > >@@ -33,12 +33,14 @@ > // Constructor and lifecycle management > > // initialize inherited and local state >+ > public WhenTag() { > super(); > init(); > } > > // Releases any resources we may have (or inherit) >+ > @Override > public void release() { > super.release(); >@@ -73,6 +75,7 @@ > // Private utility methods > > // resets internal state >+ > private void init() { > select = null; > } >Index: src/main/java/org/apache/taglibs/standard/tag/common/fmt/ParseNumberSupport.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/fmt/ParseNumberSupport.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/fmt/ParseNumberSupport.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.fmt; > >@@ -44,7 +44,7 @@ > //********************************************************************* > // Private constants > >- private static final String NUMBER = "number"; >+ private static final String NUMBER = "number"; > private static final String CURRENCY = "currency"; > private static final String PERCENT = "percent"; > >@@ -53,7 +53,7 @@ > // Protected state > > protected String value; // 'value' attribute >- protected boolean valueSpecified; // status >+ protected boolean valueSpecified; // status > protected String type; // 'type' attribute > protected String pattern; // 'pattern' attribute > protected Locale parseLocale; // 'parseLocale' attribute >@@ -72,20 +72,20 @@ > // Constructor and initialization > > public ParseNumberSupport() { >- super(); >- init(); >+ super(); >+ init(); > } > > private void init() { >- value = type = pattern = var = null; >- valueSpecified = false; >- parseLocale = null; >- integerOnlySpecified = false; >- scope = PageContext.PAGE_SCOPE; >+ value = type = pattern = var = null; >+ valueSpecified = false; >+ parseLocale = null; >+ integerOnlySpecified = false; >+ scope = PageContext.PAGE_SCOPE; > } > > >- //********************************************************************* >+ //********************************************************************* > // Tag attributes known at translation time > > public void setVar(String var) { >@@ -93,7 +93,7 @@ > } > > public void setScope(String scope) { >- this.scope = Util.getScope(scope); >+ this.scope = Util.getScope(scope); > } > > >@@ -102,82 +102,86 @@ > > @Override > public int doEndTag() throws JspException { >- String input = null; >+ String input = null; > > // determine the input by... >- if (valueSpecified) { >- // ... reading 'value' attribute >- input = value; >- } else { >- // ... retrieving and trimming our body >- if (bodyContent != null && bodyContent.getString() != null) >- input = bodyContent.getString().trim(); >- } >+ if (valueSpecified) { >+ // ... reading 'value' attribute >+ input = value; >+ } else { >+ // ... retrieving and trimming our body >+ if (bodyContent != null && bodyContent.getString() != null) { >+ input = bodyContent.getString().trim(); >+ } >+ } > >- if ((input == null) || input.equals("")) { >- if (var != null) { >- pageContext.removeAttribute(var, scope); >- } >- return EVAL_PAGE; >- } >+ if ((input == null) || input.equals("")) { >+ if (var != null) { >+ pageContext.removeAttribute(var, scope); >+ } >+ return EVAL_PAGE; >+ } > >- /* >- * Set up parsing locale: Use locale specified via the 'parseLocale' >- * attribute (if present), or else determine page's locale. >- */ >- Locale loc = parseLocale; >- if (loc == null) >- loc = SetLocaleSupport.getFormattingLocale( >- pageContext, >- this, >- false, >- NumberFormat.getAvailableLocales()); >- if (loc == null) { >- throw new JspException( >+ /* >+ * Set up parsing locale: Use locale specified via the 'parseLocale' >+ * attribute (if present), or else determine page's locale. >+ */ >+ Locale loc = parseLocale; >+ if (loc == null) { >+ loc = SetLocaleSupport.getFormattingLocale( >+ pageContext, >+ this, >+ false, >+ NumberFormat.getAvailableLocales()); >+ } >+ if (loc == null) { >+ throw new JspException( > Resources.getMessage("PARSE_NUMBER_NO_PARSE_LOCALE")); >- } >+ } > >- // Create parser >- NumberFormat parser = null; >- if ((pattern != null) && !pattern.equals("")) { >- // if 'pattern' is specified, 'type' is ignored >- DecimalFormatSymbols symbols = new DecimalFormatSymbols(loc); >- parser = new DecimalFormat(pattern, symbols); >- } else { >- parser = createParser(loc); >- } >+ // Create parser >+ NumberFormat parser = null; >+ if ((pattern != null) && !pattern.equals("")) { >+ // if 'pattern' is specified, 'type' is ignored >+ DecimalFormatSymbols symbols = new DecimalFormatSymbols(loc); >+ parser = new DecimalFormat(pattern, symbols); >+ } else { >+ parser = createParser(loc); >+ } > >- // Configure parser >- if (integerOnlySpecified) >- parser.setParseIntegerOnly(isIntegerOnly); >+ // Configure parser >+ if (integerOnlySpecified) { >+ parser.setParseIntegerOnly(isIntegerOnly); >+ } > >- // Parse number >- Number parsed = null; >- try { >- parsed = parser.parse(input); >- } catch (ParseException pe) { >- throw new JspException( >- Resources.getMessage("PARSE_NUMBER_PARSE_ERROR", input), >- pe); >- } >+ // Parse number >+ Number parsed = null; >+ try { >+ parsed = parser.parse(input); >+ } catch (ParseException pe) { >+ throw new JspException( >+ Resources.getMessage("PARSE_NUMBER_PARSE_ERROR", input), >+ pe); >+ } > >- if (var != null) { >- pageContext.setAttribute(var, parsed, scope); >- } else { >- try { >- pageContext.getOut().print(parsed); >- } catch (IOException ioe) { >- throw new JspTagException(ioe.toString(), ioe); >- } >- } >+ if (var != null) { >+ pageContext.setAttribute(var, parsed, scope); >+ } else { >+ try { >+ pageContext.getOut().print(parsed); >+ } catch (IOException ioe) { >+ throw new JspTagException(ioe.toString(), ioe); >+ } >+ } > >- return EVAL_PAGE; >+ return EVAL_PAGE; > } > > // Releases any resources we may have (or inherit) >+ > @Override > public void release() { >- init(); >+ init(); > } > > >@@ -185,20 +189,20 @@ > // Private utility methods > > private NumberFormat createParser(Locale loc) throws JspException { >- NumberFormat parser = null; >+ NumberFormat parser = null; > >- if ((type == null) || NUMBER.equalsIgnoreCase(type)) { >- parser = NumberFormat.getNumberInstance(loc); >- } else if (CURRENCY.equalsIgnoreCase(type)) { >- parser = NumberFormat.getCurrencyInstance(loc); >- } else if (PERCENT.equalsIgnoreCase(type)) { >- parser = NumberFormat.getPercentInstance(loc); >- } else { >- throw new JspException( >- Resources.getMessage("PARSE_NUMBER_INVALID_TYPE", >- type)); >- } >+ if ((type == null) || NUMBER.equalsIgnoreCase(type)) { >+ parser = NumberFormat.getNumberInstance(loc); >+ } else if (CURRENCY.equalsIgnoreCase(type)) { >+ parser = NumberFormat.getCurrencyInstance(loc); >+ } else if (PERCENT.equalsIgnoreCase(type)) { >+ parser = NumberFormat.getPercentInstance(loc); >+ } else { >+ throw new JspException( >+ Resources.getMessage("PARSE_NUMBER_INVALID_TYPE", >+ type)); >+ } > >- return parser; >+ return parser; > } > } >Index: src/main/java/org/apache/taglibs/standard/tag/common/fmt/MessageSupport.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/fmt/MessageSupport.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/fmt/MessageSupport.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.fmt; > >@@ -53,7 +53,7 @@ > // Protected state > > protected String keyAttrValue; // 'key' attribute value >- protected boolean keySpecified; // 'key' attribute specified >+ protected boolean keySpecified; // 'key' attribute specified > protected LocalizationContext bundleAttrValue; // 'bundle' attribute value > protected boolean bundleSpecified; // 'bundle' attribute specified? > >@@ -70,18 +70,18 @@ > // Constructor and initialization > > public MessageSupport() { >- super(); >- params = new ArrayList(); >- init(); >+ super(); >+ params = new ArrayList(); >+ init(); > } > > private void init() { >- var = null; >- scope = PageContext.PAGE_SCOPE; >- keyAttrValue = null; >- keySpecified = false; >- bundleAttrValue = null; >- bundleSpecified = false; >+ var = null; >+ scope = PageContext.PAGE_SCOPE; >+ keyAttrValue = null; >+ keySpecified = false; >+ bundleAttrValue = null; >+ bundleSpecified = false; > } > > >@@ -93,7 +93,7 @@ > } > > public void setScope(String scope) { >- this.scope = Util.getScope(scope); >+ this.scope = Util.getScope(scope); > } > > >@@ -106,7 +106,7 @@ > * @see ParamSupport > */ > public void addParam(Object arg) { >- params.add(arg); >+ params.add(arg); > } > > >@@ -115,71 +115,73 @@ > > @Override > public int doStartTag() throws JspException { >- params.clear(); >- return EVAL_BODY_BUFFERED; >+ params.clear(); >+ return EVAL_BODY_BUFFERED; > } > > @Override > public int doEndTag() throws JspException { > > String key = null; >- LocalizationContext locCtxt = null; >+ LocalizationContext locCtxt = null; > > // determine the message key by... > if (keySpecified) { >- // ... reading 'key' attribute >- key = keyAttrValue; >- } else { >- // ... retrieving and trimming our body >- if (bodyContent != null && bodyContent.getString() != null) >- key = bodyContent.getString().trim(); >- } >+ // ... reading 'key' attribute >+ key = keyAttrValue; >+ } else { >+ // ... retrieving and trimming our body >+ if (bodyContent != null && bodyContent.getString() != null) { >+ key = bodyContent.getString().trim(); >+ } >+ } > >- if ((key == null) || key.equals("")) { >- try { >- pageContext.getOut().print("??????"); >- } catch (IOException ioe) { >- throw new JspTagException(ioe.toString(), ioe); >- } >- return EVAL_PAGE; >- } >+ if ((key == null) || key.equals("")) { >+ try { >+ pageContext.getOut().print("??????"); >+ } catch (IOException ioe) { >+ throw new JspTagException(ioe.toString(), ioe); >+ } >+ return EVAL_PAGE; >+ } > >- String prefix = null; >- if (!bundleSpecified) { >- Tag t = findAncestorWithClass(this, BundleSupport.class); >- if (t != null) { >- // use resource bundle from parent <bundle> tag >- BundleSupport parent = (BundleSupport) t; >- locCtxt = parent.getLocalizationContext(); >- prefix = parent.getPrefix(); >- } else { >- locCtxt = BundleSupport.getLocalizationContext(pageContext); >- } >- } else { >- // localization context taken from 'bundle' attribute >- locCtxt = bundleAttrValue; >- if (locCtxt.getLocale() != null) { >- SetLocaleSupport.setResponseLocale(pageContext, >- locCtxt.getLocale()); >- } >- } >- >- 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) >- key = prefix + key; >- message = bundle.getString(key); >- // Perform parametric replacement if required >- if (!params.isEmpty()) { >- Object[] messageArgs = params.toArray(); >- MessageFormat formatter = new MessageFormat(""); // empty pattern, default Locale >- if (locCtxt.getLocale() != null) { >- formatter.setLocale(locCtxt.getLocale()); >- } else { >+ String prefix = null; >+ if (!bundleSpecified) { >+ Tag t = findAncestorWithClass(this, BundleSupport.class); >+ if (t != null) { >+ // use resource bundle from parent <bundle> tag >+ BundleSupport parent = (BundleSupport) t; >+ locCtxt = parent.getLocalizationContext(); >+ prefix = parent.getPrefix(); >+ } else { >+ locCtxt = BundleSupport.getLocalizationContext(pageContext); >+ } >+ } else { >+ // localization context taken from 'bundle' attribute >+ locCtxt = bundleAttrValue; >+ if (locCtxt.getLocale() != null) { >+ SetLocaleSupport.setResponseLocale(pageContext, >+ locCtxt.getLocale()); >+ } >+ } >+ >+ 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) { >+ key = prefix + key; >+ } >+ message = bundle.getString(key); >+ // Perform parametric replacement if required >+ if (!params.isEmpty()) { >+ Object[] messageArgs = params.toArray(); >+ MessageFormat formatter = new MessageFormat(""); // empty pattern, default Locale >+ if (locCtxt.getLocale() != null) { >+ formatter.setLocale(locCtxt.getLocale()); >+ } else { > // For consistency with the <fmt:formatXXX> actions, > // we try to get a locale that matches the user's preferences > // as well as the locales supported by 'date' and 'number'. >@@ -190,31 +192,32 @@ > formatter.setLocale(locale); > } > } >- formatter.applyPattern(message); >- message = formatter.format(messageArgs); >- } >- } catch (MissingResourceException mre) { >- message = UNDEFINED_KEY + key + UNDEFINED_KEY; >- } >- } >- } >+ formatter.applyPattern(message); >+ message = formatter.format(messageArgs); >+ } >+ } catch (MissingResourceException mre) { >+ message = UNDEFINED_KEY + key + UNDEFINED_KEY; >+ } >+ } >+ } > >- if (var != null) { >- pageContext.setAttribute(var, message, scope); >- } else { >- try { >- pageContext.getOut().print(message); >- } catch (IOException ioe) { >- throw new JspTagException(ioe.toString(), ioe); >- } >- } >+ if (var != null) { >+ pageContext.setAttribute(var, message, scope); >+ } else { >+ try { >+ pageContext.getOut().print(message); >+ } catch (IOException ioe) { >+ throw new JspTagException(ioe.toString(), ioe); >+ } >+ } > >- return EVAL_PAGE; >+ return EVAL_PAGE; > } > > // Releases any resources we may have (or inherit) >+ > @Override > public void release() { >- init(); >+ init(); > } > } >Index: src/main/java/org/apache/taglibs/standard/tag/common/fmt/SetBundleSupport.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/fmt/SetBundleSupport.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/fmt/SetBundleSupport.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.fmt; > >@@ -34,7 +34,7 @@ > > public abstract class SetBundleSupport extends TagSupport { > >- >+ > //********************************************************************* > // Protected state > >@@ -52,13 +52,13 @@ > // Constructor and initialization > > public SetBundleSupport() { >- super(); >- init(); >+ super(); >+ init(); > } > > private void init() { >- basename = null; >- scope = PageContext.PAGE_SCOPE; >+ basename = null; >+ scope = PageContext.PAGE_SCOPE; > } > > >@@ -70,7 +70,7 @@ > } > > public void setScope(String scope) { >- this.scope = Util.getScope(scope); >+ this.scope = Util.getScope(scope); > } > > >@@ -79,22 +79,23 @@ > > @Override > public int doEndTag() throws JspException { >- LocalizationContext locCtxt = >- BundleSupport.getLocalizationContext(pageContext, basename); >+ LocalizationContext locCtxt = >+ BundleSupport.getLocalizationContext(pageContext, basename); > >- if (var != null) { >- pageContext.setAttribute(var, locCtxt, scope); >- } else { >- Config.set(pageContext, Config.FMT_LOCALIZATION_CONTEXT, locCtxt, >- scope); >- } >+ if (var != null) { >+ pageContext.setAttribute(var, locCtxt, scope); >+ } else { >+ Config.set(pageContext, Config.FMT_LOCALIZATION_CONTEXT, locCtxt, >+ scope); >+ } > >- return EVAL_PAGE; >+ return EVAL_PAGE; > } > > // Releases any resources we may have (or inherit) >+ > @Override > public void release() { >- init(); >+ init(); > } > } >Index: src/main/java/org/apache/taglibs/standard/tag/common/fmt/FormatDateSupport.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/fmt/FormatDateSupport.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/fmt/FormatDateSupport.java (working copy) >@@ -13,14 +13,19 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.fmt; > > import java.io.IOException; > import java.text.DateFormat; > import java.text.SimpleDateFormat; >-import java.util.*; >+import java.util.Collections; >+import java.util.Date; >+import java.util.LinkedHashMap; >+import java.util.Locale; >+import java.util.Map; >+import java.util.TimeZone; > > import javax.servlet.jsp.JspException; > import javax.servlet.jsp.JspTagException; >@@ -42,12 +47,12 @@ > //********************************************************************* > // Private constants > >- /** >- * Name of configuration setting for maximum number of entries in the >- * cached dateformat map >- */ >- private static final String DATE_CACHE_PARAM = >- "org.apache.taglibs.standard.tag.common.fmt.dateFormatCacheSize"; >+ /** >+ * Name of configuration setting for maximum number of entries in the >+ * cached dateformat map >+ */ >+ private static final String DATE_CACHE_PARAM = >+ "org.apache.taglibs.standard.tag.common.fmt.dateFormatCacheSize"; > > private static final String DATE = "date"; > private static final String TIME = "time"; >@@ -55,10 +60,10 @@ > > private static Map dateFormatCache = null; > >- /** >- * Default maximum cache size >- */ >- private static final int MAX_SIZE = 100; >+ /** >+ * Default maximum cache size >+ */ >+ private static final int MAX_SIZE = 100; > > > //********************************************************************* >@@ -83,20 +88,20 @@ > // Constructor and initialization > > public FormatDateSupport() { >- super(); >- init(); >+ super(); >+ init(); > } > > private void init() { >- type = dateStyle = timeStyle = null; >- pattern = var = null; >- value = null; >- timeZone = null; >- scope = PageContext.PAGE_SCOPE; >+ type = dateStyle = timeStyle = null; >+ pattern = var = null; >+ value = null; >+ timeZone = null; >+ scope = PageContext.PAGE_SCOPE; > } > > >- //********************************************************************* >+ //********************************************************************* > // Tag attributes known at translation time > > public void setVar(String var) { >@@ -104,7 +109,7 @@ > } > > public void setScope(String scope) { >- this.scope = Util.getScope(scope); >+ this.scope = Util.getScope(scope); > } > > >@@ -114,72 +119,74 @@ > /* > * Formats the given date and time. > */ >+ > @Override > public int doEndTag() throws JspException { > >- String formatted = null; >+ String formatted = null; > >- if (value == null) { >- if (var != null) { >- pageContext.removeAttribute(var, scope); >- } >- return EVAL_PAGE; >- } >+ if (value == null) { >+ if (var != null) { >+ pageContext.removeAttribute(var, scope); >+ } >+ return EVAL_PAGE; >+ } > >- // Create formatter >- Locale locale = SetLocaleSupport.getFormattingLocale( >- pageContext, >- this, >- true, >- DateFormat.getAvailableLocales()); >+ // Create formatter >+ Locale locale = SetLocaleSupport.getFormattingLocale( >+ pageContext, >+ this, >+ true, >+ DateFormat.getAvailableLocales()); > >- if (locale != null) { >- DateFormat formatter = createFormatter(locale, pattern); >+ if (locale != null) { >+ DateFormat formatter = createFormatter(locale, pattern); > >- // Set time zone >- TimeZone tz = null; >- if ((timeZone instanceof String) >- && ((String) timeZone).equals("")) { >- timeZone = null; >- } >- if (timeZone != null) { >- if (timeZone instanceof String) { >- tz = TimeZone.getTimeZone((String) timeZone); >- } else if (timeZone instanceof TimeZone) { >- tz = (TimeZone) timeZone; >- } else { >- throw new JspTagException( >+ // Set time zone >+ TimeZone tz = null; >+ if ((timeZone instanceof String) >+ && ((String) timeZone).equals("")) { >+ timeZone = null; >+ } >+ if (timeZone != null) { >+ if (timeZone instanceof String) { >+ tz = TimeZone.getTimeZone((String) timeZone); >+ } else if (timeZone instanceof TimeZone) { >+ tz = (TimeZone) timeZone; >+ } else { >+ throw new JspTagException( > Resources.getMessage("FORMAT_DATE_BAD_TIMEZONE")); >- } >- } else { >- tz = TimeZoneSupport.getTimeZone(pageContext, this); >- } >- if (tz != null) { >- formatter.setTimeZone(tz); >- } >- formatted = formatter.format(value); >- } else { >- // no formatting locale available, use Date.toString() >- formatted = value.toString(); >- } >+ } >+ } else { >+ tz = TimeZoneSupport.getTimeZone(pageContext, this); >+ } >+ if (tz != null) { >+ formatter.setTimeZone(tz); >+ } >+ formatted = formatter.format(value); >+ } else { >+ // no formatting locale available, use Date.toString() >+ formatted = value.toString(); >+ } > >- if (var != null) { >- pageContext.setAttribute(var, formatted, scope); >- } else { >- try { >- pageContext.getOut().print(formatted); >- } catch (IOException ioe) { >- throw new JspTagException(ioe.toString(), ioe); >- } >- } >+ if (var != null) { >+ pageContext.setAttribute(var, formatted, scope); >+ } else { >+ try { >+ pageContext.getOut().print(formatted); >+ } catch (IOException ioe) { >+ throw new JspTagException(ioe.toString(), ioe); >+ } >+ } > >- return EVAL_PAGE; >+ return EVAL_PAGE; > } > > // Releases any resources we may have (or inherit) >+ > @Override > public void release() { >- init(); >+ init(); > } > > >@@ -187,82 +194,82 @@ > // Private utility methods > > private DateFormat createFormatter(Locale loc, String pattern) throws JspException { >- DateFormat formatter = null; >+ DateFormat formatter = null; > >- // lazy initialization of cache >- if (dateFormatCache == null) { >- String value = pageContext.getServletContext().getInitParameter(DATE_CACHE_PARAM); >- final int maxSize = (value != null) ? Integer.parseInt(value) : MAX_SIZE; >- dateFormatCache = Collections.synchronizedMap(new LinkedHashMap() { >- @Override >- protected boolean removeEldestEntry(Map.Entry eldest) { >- return size() > maxSize; >+ // lazy initialization of cache >+ if (dateFormatCache == null) { >+ String value = pageContext.getServletContext().getInitParameter(DATE_CACHE_PARAM); >+ final int maxSize = (value != null) ? Integer.parseInt(value) : MAX_SIZE; >+ dateFormatCache = Collections.synchronizedMap(new LinkedHashMap() { >+ @Override >+ protected boolean removeEldestEntry(Map.Entry eldest) { >+ return size() > maxSize; >+ } >+ }); >+ } >+ >+ // Apply pattern, if present >+ if (pattern != null) { >+ if ((type == null) || DATE.equalsIgnoreCase(type)) { >+ String key = DATE + pattern + loc; >+ formatter = (DateFormat) dateFormatCache.get(key); >+ if (formatter == null) { >+ formatter = new SimpleDateFormat(pattern, loc); >+ dateFormatCache.put(key, formatter); >+ } >+ } else if (TIME.equalsIgnoreCase(type)) { >+ String key = TIME + pattern + loc; >+ formatter = (DateFormat) dateFormatCache.get(key); >+ if (formatter == null) { >+ formatter = new SimpleDateFormat(pattern, loc); >+ dateFormatCache.put(key, formatter); >+ } >+ } else if (DATETIME.equalsIgnoreCase(type)) { >+ String key = DATETIME + pattern + loc; >+ formatter = (DateFormat) dateFormatCache.get(key); >+ if (formatter == null) { >+ formatter = new SimpleDateFormat(pattern, loc); >+ dateFormatCache.put(key, formatter); >+ } >+ } else { >+ throw new JspException( >+ Resources.getMessage("FORMAT_DATE_INVALID_TYPE", >+ type)); > } >- }); >- } >+ return formatter; >+ } > >- // Apply pattern, if present >- if (pattern != null) { >- if ((type == null) || DATE.equalsIgnoreCase(type)) { >- String key = DATE + pattern + loc; >+ if ((type == null) || DATE.equalsIgnoreCase(type)) { >+ int style = Util.getStyle(dateStyle, "FORMAT_DATE_INVALID_DATE_STYLE"); >+ String key = DATE + style + loc; > formatter = (DateFormat) dateFormatCache.get(key); >- if(formatter == null) { >- formatter = new SimpleDateFormat(pattern, loc); >+ if (formatter == null) { >+ formatter = DateFormat.getDateInstance(style, loc); > dateFormatCache.put(key, formatter); > } >- } else if (TIME.equalsIgnoreCase(type)) { >- String key = TIME + pattern + loc; >+ } else if (TIME.equalsIgnoreCase(type)) { >+ int style = Util.getStyle(timeStyle, "FORMAT_DATE_INVALID_TIME_STYLE"); >+ String key = TIME + style + loc; > formatter = (DateFormat) dateFormatCache.get(key); >- if(formatter == null) { >- formatter = new SimpleDateFormat(pattern, loc); >+ if (formatter == null) { >+ formatter = DateFormat.getTimeInstance(style, loc); > dateFormatCache.put(key, formatter); > } >- } else if (DATETIME.equalsIgnoreCase(type)) { >- String key = DATETIME + pattern + loc; >+ } else if (DATETIME.equalsIgnoreCase(type)) { >+ int style1 = Util.getStyle(dateStyle, "FORMAT_DATE_INVALID_DATE_STYLE"); >+ int style2 = Util.getStyle(timeStyle, "FORMAT_DATE_INVALID_TIME_STYLE"); >+ String key = DATETIME + style1 + loc + style2; > formatter = (DateFormat) dateFormatCache.get(key); >- if(formatter == null) { >- formatter = new SimpleDateFormat(pattern, loc); >+ if (formatter == null) { >+ formatter = DateFormat.getDateTimeInstance(style1, style2, loc); > dateFormatCache.put(key, formatter); > } >- } else { >- throw new JspException( >- Resources.getMessage("FORMAT_DATE_INVALID_TYPE", >- type)); >- } >+ } else { >+ throw new JspException( >+ Resources.getMessage("FORMAT_DATE_INVALID_TYPE", >+ type)); >+ } >+ > return formatter; >- } >- >- if ((type == null) || DATE.equalsIgnoreCase(type)) { >- int style = Util.getStyle(dateStyle, "FORMAT_DATE_INVALID_DATE_STYLE"); >- String key = DATE + style + loc; >- formatter = (DateFormat) dateFormatCache.get(key); >- if(formatter == null) { >- formatter = DateFormat.getDateInstance(style, loc); >- dateFormatCache.put(key, formatter); >- } >- } else if (TIME.equalsIgnoreCase(type)) { >- int style = Util.getStyle(timeStyle, "FORMAT_DATE_INVALID_TIME_STYLE"); >- String key = TIME + style + loc; >- formatter = (DateFormat) dateFormatCache.get(key); >- if(formatter == null) { >- formatter = DateFormat.getTimeInstance(style, loc); >- dateFormatCache.put(key, formatter); >- } >- } else if (DATETIME.equalsIgnoreCase(type)) { >- int style1 = Util.getStyle(dateStyle, "FORMAT_DATE_INVALID_DATE_STYLE"); >- int style2 = Util.getStyle(timeStyle, "FORMAT_DATE_INVALID_TIME_STYLE"); >- String key = DATETIME + style1 + loc + style2; >- formatter = (DateFormat) dateFormatCache.get(key); >- if(formatter == null) { >- formatter = DateFormat.getDateTimeInstance(style1, style2, loc); >- dateFormatCache.put(key, formatter); >- } >- } else { >- throw new JspException( >- Resources.getMessage("FORMAT_DATE_INVALID_TYPE", >- type)); >- } >- >- return formatter; > } > } >Index: src/main/java/org/apache/taglibs/standard/tag/common/fmt/SetTimeZoneSupport.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/fmt/SetTimeZoneSupport.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/fmt/SetTimeZoneSupport.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.fmt; > >@@ -35,7 +35,7 @@ > > public abstract class SetTimeZoneSupport extends TagSupport { > >- >+ > //********************************************************************* > // Protected state > >@@ -53,22 +53,23 @@ > // Constructor and initialization > > public SetTimeZoneSupport() { >- super(); >- init(); >+ super(); >+ init(); > } > > // resets local state >+ > private void init() { >- value = var = null; >- scope = PageContext.PAGE_SCOPE; >+ value = var = null; >+ scope = PageContext.PAGE_SCOPE; > } > > >- //********************************************************************* >+ //********************************************************************* > // Tag attributes known at translation time > > public void setScope(String scope) { >- this.scope = Util.getScope(scope); >+ this.scope = Util.getScope(scope); > } > > public void setVar(String var) { >@@ -81,32 +82,33 @@ > > @Override > public int doEndTag() throws JspException { >- TimeZone timeZone = null; >+ TimeZone timeZone = null; > >- if (value == null) { >- timeZone = TimeZone.getTimeZone("GMT"); >- } else if (value instanceof String) { >- if (((String) value).trim().equals("")) { >- timeZone = TimeZone.getTimeZone("GMT"); >- } else { >- timeZone = TimeZone.getTimeZone((String) value); >- } >- } else { >- timeZone = (TimeZone) value; >- } >+ if (value == null) { >+ timeZone = TimeZone.getTimeZone("GMT"); >+ } else if (value instanceof String) { >+ if (((String) value).trim().equals("")) { >+ timeZone = TimeZone.getTimeZone("GMT"); >+ } else { >+ timeZone = TimeZone.getTimeZone((String) value); >+ } >+ } else { >+ timeZone = (TimeZone) value; >+ } > >- if (var != null) { >- pageContext.setAttribute(var, timeZone, scope); >- } else { >- Config.set(pageContext, Config.FMT_TIME_ZONE, timeZone, scope); >- } >+ if (var != null) { >+ pageContext.setAttribute(var, timeZone, scope); >+ } else { >+ Config.set(pageContext, Config.FMT_TIME_ZONE, timeZone, scope); >+ } > >- return EVAL_PAGE; >+ return EVAL_PAGE; > } > > // Releases any resources we may have (or inherit) >+ > @Override > public void release() { >- init(); >+ init(); > } > } >Index: src/main/java/org/apache/taglibs/standard/tag/common/fmt/ParseDateSupport.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/fmt/ParseDateSupport.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/fmt/ParseDateSupport.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.fmt; > >@@ -54,7 +54,7 @@ > // Protected state > > protected String value; // 'value' attribute >- protected boolean valueSpecified; // status >+ protected boolean valueSpecified; // status > protected String type; // 'type' attribute > protected String pattern; // 'pattern' attribute > protected Object timeZone; // 'timeZone' attribute >@@ -74,21 +74,21 @@ > // Constructor and initialization > > public ParseDateSupport() { >- super(); >- init(); >+ super(); >+ init(); > } > > private void init() { >- type = dateStyle = timeStyle = null; >- value = pattern = var = null; >- valueSpecified = false; >- timeZone = null; >- scope = PageContext.PAGE_SCOPE; >- parseLocale = null; >+ type = dateStyle = timeStyle = null; >+ value = pattern = var = null; >+ valueSpecified = false; >+ timeZone = null; >+ scope = PageContext.PAGE_SCOPE; >+ parseLocale = null; > } > > >- //********************************************************************* >+ //********************************************************************* > // Tag attributes known at translation time > > public void setVar(String var) { >@@ -96,7 +96,7 @@ > } > > public void setScope(String scope) { >- this.scope = Util.getScope(scope); >+ this.scope = Util.getScope(scope); > } > > >@@ -110,97 +110,100 @@ > > // determine the input by... > if (valueSpecified) { >- // ... reading 'value' attribute >- input = value; >- } else { >- // ... retrieving and trimming our body >- if (bodyContent != null && bodyContent.getString() != null) >- input = bodyContent.getString().trim(); >- } >+ // ... reading 'value' attribute >+ input = value; >+ } else { >+ // ... retrieving and trimming our body >+ if (bodyContent != null && bodyContent.getString() != null) { >+ input = bodyContent.getString().trim(); >+ } >+ } > >- if ((input == null) || input.equals("")) { >- if (var != null) { >- pageContext.removeAttribute(var, scope); >- } >- return EVAL_PAGE; >- } >+ if ((input == null) || input.equals("")) { >+ if (var != null) { >+ pageContext.removeAttribute(var, scope); >+ } >+ return EVAL_PAGE; >+ } > >- /* >- * Set up parsing locale: Use locale specified via the 'parseLocale' >- * attribute (if present), or else determine page's locale. >- */ >- Locale locale = parseLocale; >- if (locale == null) >- locale = SetLocaleSupport.getFormattingLocale( >- pageContext, >- this, >- false, >- DateFormat.getAvailableLocales()); >- if (locale == null) { >- throw new JspException( >+ /* >+ * Set up parsing locale: Use locale specified via the 'parseLocale' >+ * attribute (if present), or else determine page's locale. >+ */ >+ Locale locale = parseLocale; >+ if (locale == null) { >+ locale = SetLocaleSupport.getFormattingLocale( >+ pageContext, >+ this, >+ false, >+ DateFormat.getAvailableLocales()); >+ } >+ if (locale == null) { >+ throw new JspException( > Resources.getMessage("PARSE_DATE_NO_PARSE_LOCALE")); >- } >+ } > >- // Create parser >- DateFormat parser = createParser(locale); >+ // Create parser >+ DateFormat parser = createParser(locale); > >- // Apply pattern, if present >- if (pattern != null) { >- try { >- ((SimpleDateFormat) parser).applyPattern(pattern); >- } catch (ClassCastException cce) { >- parser = new SimpleDateFormat(pattern, locale); >- } >- } >+ // Apply pattern, if present >+ if (pattern != null) { >+ try { >+ ((SimpleDateFormat) parser).applyPattern(pattern); >+ } catch (ClassCastException cce) { >+ parser = new SimpleDateFormat(pattern, locale); >+ } >+ } > >- // Set time zone >- TimeZone tz = null; >- if ((timeZone instanceof String) && ((String) timeZone).equals("")) { >- timeZone = null; >- } >- if (timeZone != null) { >- if (timeZone instanceof String) { >- tz = TimeZone.getTimeZone((String) timeZone); >- } else if (timeZone instanceof TimeZone) { >- tz = (TimeZone) timeZone; >- } else { >- throw new JspException( >- Resources.getMessage("PARSE_DATE_BAD_TIMEZONE")); >- } >- } else { >- tz = TimeZoneSupport.getTimeZone(pageContext, this); >- } >- if (tz != null) { >- parser.setTimeZone(tz); >- } >+ // Set time zone >+ TimeZone tz = null; >+ if ((timeZone instanceof String) && ((String) timeZone).equals("")) { >+ timeZone = null; >+ } >+ if (timeZone != null) { >+ if (timeZone instanceof String) { >+ tz = TimeZone.getTimeZone((String) timeZone); >+ } else if (timeZone instanceof TimeZone) { >+ tz = (TimeZone) timeZone; >+ } else { >+ throw new JspException( >+ Resources.getMessage("PARSE_DATE_BAD_TIMEZONE")); >+ } >+ } else { >+ tz = TimeZoneSupport.getTimeZone(pageContext, this); >+ } >+ if (tz != null) { >+ parser.setTimeZone(tz); >+ } > >- // Parse date >- Date parsed = null; >- try { >- parsed = parser.parse(input); >- } catch (ParseException pe) { >- throw new JspException( >- Resources.getMessage("PARSE_DATE_PARSE_ERROR", input), >- pe); >- } >+ // Parse date >+ Date parsed = null; >+ try { >+ parsed = parser.parse(input); >+ } catch (ParseException pe) { >+ throw new JspException( >+ Resources.getMessage("PARSE_DATE_PARSE_ERROR", input), >+ pe); >+ } > >- if (var != null) { >- pageContext.setAttribute(var, parsed, scope); >- } else { >- try { >- pageContext.getOut().print(parsed); >- } catch (IOException ioe) { >- throw new JspTagException(ioe.toString(), ioe); >- } >- } >+ if (var != null) { >+ pageContext.setAttribute(var, parsed, scope); >+ } else { >+ try { >+ pageContext.getOut().print(parsed); >+ } catch (IOException ioe) { >+ throw new JspTagException(ioe.toString(), ioe); >+ } >+ } > >- return EVAL_PAGE; >+ return EVAL_PAGE; > } > > // Releases any resources we may have (or inherit) >+ > @Override > public void release() { >- init(); >+ init(); > } > > >@@ -208,28 +211,28 @@ > // Private utility methods > > private DateFormat createParser(Locale loc) throws JspException { >- DateFormat parser = null; >+ DateFormat parser = null; > >- if ((type == null) || DATE.equalsIgnoreCase(type)) { >- parser = DateFormat.getDateInstance( >- Util.getStyle(dateStyle, "PARSE_DATE_INVALID_DATE_STYLE"), >- loc); >- } else if (TIME.equalsIgnoreCase(type)) { >- parser = DateFormat.getTimeInstance( >- Util.getStyle(timeStyle, "PARSE_DATE_INVALID_TIME_STYLE"), >- loc); >- } else if (DATETIME.equalsIgnoreCase(type)) { >- parser = DateFormat.getDateTimeInstance( >- Util.getStyle(dateStyle, "PARSE_DATE_INVALID_DATE_STYLE"), >- Util.getStyle(timeStyle, "PARSE_DATE_INVALID_TIME_STYLE"), >- loc); >- } else { >- throw new JspException( >+ if ((type == null) || DATE.equalsIgnoreCase(type)) { >+ parser = DateFormat.getDateInstance( >+ Util.getStyle(dateStyle, "PARSE_DATE_INVALID_DATE_STYLE"), >+ loc); >+ } else if (TIME.equalsIgnoreCase(type)) { >+ parser = DateFormat.getTimeInstance( >+ Util.getStyle(timeStyle, "PARSE_DATE_INVALID_TIME_STYLE"), >+ loc); >+ } else if (DATETIME.equalsIgnoreCase(type)) { >+ parser = DateFormat.getDateTimeInstance( >+ Util.getStyle(dateStyle, "PARSE_DATE_INVALID_DATE_STYLE"), >+ Util.getStyle(timeStyle, "PARSE_DATE_INVALID_TIME_STYLE"), >+ loc); >+ } else { >+ throw new JspException( > Resources.getMessage("PARSE_DATE_INVALID_TYPE", type)); >- } >+ } > >- parser.setLenient(false); >+ parser.setLenient(false); > >- return parser; >+ return parser; > } > } >Index: src/main/java/org/apache/taglibs/standard/tag/common/fmt/BundleSupport.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/fmt/BundleSupport.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/fmt/BundleSupport.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.fmt; > >@@ -41,8 +41,8 @@ > */ > > public abstract class BundleSupport extends BodyTagSupport { >- > >+ > //********************************************************************* > // Private constants > >@@ -67,25 +67,25 @@ > // Constructor and initialization > > public BundleSupport() { >- super(); >- init(); >+ super(); >+ init(); > } > > private void init() { >- basename = prefix = null; >- locCtxt = null; >+ basename = prefix = null; >+ locCtxt = null; > } > >- >+ > //********************************************************************* > // Collaboration with subtags > > public LocalizationContext getLocalizationContext() { >- return locCtxt; >+ return locCtxt; > } > > public String getPrefix() { >- return prefix; >+ return prefix; > } > > >@@ -94,28 +94,29 @@ > > @Override > public int doStartTag() throws JspException { >- locCtxt = getLocalizationContext(pageContext, basename); >- return EVAL_BODY_BUFFERED; >+ locCtxt = getLocalizationContext(pageContext, basename); >+ return EVAL_BODY_BUFFERED; > } > > @Override > public int doEndTag() throws JspException { >- if (bodyContent != null) { >- try { >- pageContext.getOut().print(bodyContent.getString()); >- } catch (IOException ioe) { >- throw new JspTagException(ioe.toString(), ioe); >- } >- } >+ if (bodyContent != null) { >+ try { >+ pageContext.getOut().print(bodyContent.getString()); >+ } catch (IOException ioe) { >+ throw new JspTagException(ioe.toString(), ioe); >+ } >+ } > >- return EVAL_PAGE; >+ return EVAL_PAGE; > } > > // Releases any resources we may have (or inherit) >+ > @Override > public void release() { > super.release(); >- init(); >+ init(); > } > > >@@ -126,142 +127,142 @@ > * Gets the default I18N localization context. > * > * @param pc Page in which to look up the default I18N localization context >- */ >+ */ > public static LocalizationContext getLocalizationContext(PageContext pc) { >- LocalizationContext locCtxt = null; >+ LocalizationContext locCtxt = null; > >- Object obj = Config.find(pc, Config.FMT_LOCALIZATION_CONTEXT); >- if (obj == null) { >- return null; >- } >+ Object obj = Config.find(pc, Config.FMT_LOCALIZATION_CONTEXT); >+ if (obj == null) { >+ return null; >+ } > >- if (obj instanceof LocalizationContext) { >- locCtxt = (LocalizationContext) obj; >- } else { >- // localization context is a bundle basename >- locCtxt = getLocalizationContext(pc, (String) obj); >- } >+ if (obj instanceof LocalizationContext) { >+ locCtxt = (LocalizationContext) obj; >+ } else { >+ // localization context is a bundle basename >+ locCtxt = getLocalizationContext(pc, (String) obj); >+ } > >- return locCtxt; >+ return locCtxt; > } > > /** > * Gets the resource bundle with the given base name, whose locale is > * determined as follows: >- * >+ * <p/> > * Check if a match exists between the ordered set of preferred > * locales and the available locales, for the given base name. > * The set of preferred locales consists of a single locale > * (if the <tt>javax.servlet.jsp.jstl.fmt.locale</tt> configuration > * setting is present) or is equal to the client's preferred locales > * determined from the client's browser settings. >- * >+ * <p/> > * <p> If no match was found in the previous step, check if a match > * exists between the fallback locale (given by the > * <tt>javax.servlet.jsp.jstl.fmt.fallbackLocale</tt> configuration > * setting) and the available locales, for the given base name. > * >- * @param pc Page in which the resource bundle with the >- * given base name is requested >+ * @param pc Page in which the resource bundle with the >+ * given base name is requested > * @param basename Resource bundle base name >- * > * @return Localization context containing the resource bundle with the >- * given base name and the locale that led to the resource bundle match, >- * or the empty localization context if no resource bundle match was found >+ * given base name and the locale that led to the resource bundle match, >+ * or the empty localization context if no resource bundle match was found > */ > public static LocalizationContext getLocalizationContext(PageContext pc, >- String basename) { >- LocalizationContext locCtxt = null; >- ResourceBundle bundle = null; >+ String basename) { >+ LocalizationContext locCtxt = null; >+ ResourceBundle bundle = null; > >- if ((basename == null) || basename.equals("")) { >- return new LocalizationContext(); >- } >+ if ((basename == null) || basename.equals("")) { >+ return new LocalizationContext(); >+ } > >- // Try preferred locales >- Locale pref = SetLocaleSupport.getLocale(pc, Config.FMT_LOCALE); >- if (pref != null) { >- // Preferred locale is application-based >- bundle = findMatch(basename, pref); >- if (bundle != null) { >- locCtxt = new LocalizationContext(bundle, pref); >- } >- } else { >- // Preferred locales are browser-based >- locCtxt = findMatch(pc, basename); >- } >- >- if (locCtxt == null) { >- // No match found with preferred locales, try using fallback locale >- pref = SetLocaleSupport.getLocale(pc, Config.FMT_FALLBACK_LOCALE); >- if (pref != null) { >- bundle = findMatch(basename, pref); >- if (bundle != null) { >- locCtxt = new LocalizationContext(bundle, pref); >- } >- } >- } >+ // Try preferred locales >+ Locale pref = SetLocaleSupport.getLocale(pc, Config.FMT_LOCALE); >+ if (pref != null) { >+ // Preferred locale is application-based >+ bundle = findMatch(basename, pref); >+ if (bundle != null) { >+ locCtxt = new LocalizationContext(bundle, pref); >+ } >+ } else { >+ // Preferred locales are browser-based >+ locCtxt = findMatch(pc, basename); >+ } > >- if (locCtxt == null) { >- // try using the root resource bundle with the given basename >- try { >- ClassLoader cl = getClassLoaderCheckingPrivilege(); >- bundle = ResourceBundle.getBundle(basename, EMPTY_LOCALE, cl); >- if (bundle != null) { >- locCtxt = new LocalizationContext(bundle, null); >- } >- } catch (MissingResourceException mre) { >- // do nothing >- } >- } >- >- if (locCtxt != null) { >- // set response locale >- if (locCtxt.getLocale() != null) { >- SetLocaleSupport.setResponseLocale(pc, locCtxt.getLocale()); >- } >- } else { >- // create empty localization context >- locCtxt = new LocalizationContext(); >- } >+ if (locCtxt == null) { >+ // No match found with preferred locales, try using fallback locale >+ pref = SetLocaleSupport.getLocale(pc, Config.FMT_FALLBACK_LOCALE); >+ if (pref != null) { >+ bundle = findMatch(basename, pref); >+ if (bundle != null) { >+ locCtxt = new LocalizationContext(bundle, pref); >+ } >+ } >+ } > >- return locCtxt; >+ if (locCtxt == null) { >+ // try using the root resource bundle with the given basename >+ try { >+ ClassLoader cl = getClassLoaderCheckingPrivilege(); >+ bundle = ResourceBundle.getBundle(basename, EMPTY_LOCALE, cl); >+ if (bundle != null) { >+ locCtxt = new LocalizationContext(bundle, null); >+ } >+ } catch (MissingResourceException mre) { >+ // do nothing >+ } >+ } >+ >+ if (locCtxt != null) { >+ // set response locale >+ if (locCtxt.getLocale() != null) { >+ SetLocaleSupport.setResponseLocale(pc, locCtxt.getLocale()); >+ } >+ } else { >+ // create empty localization context >+ locCtxt = new LocalizationContext(); >+ } >+ >+ return locCtxt; > } > > > //********************************************************************* > // Private utility methods >- >+ > /* >- * Determines the client's preferred locales from the request, and compares >- * each of the locales (in order of preference) against the available >- * locales in order to determine the best matching locale. >- * >- * @param pageContext the page in which the resource bundle with the >- * given base name is requested >- * @param basename the resource bundle's base name >- * >- * @return the localization context containing the resource bundle with >- * the given base name and best matching locale, or <tt>null</tt> if no >- * resource bundle match was found >- */ >+ * Determines the client's preferred locales from the request, and compares >+ * each of the locales (in order of preference) against the available >+ * locales in order to determine the best matching locale. >+ * >+ * @param pageContext the page in which the resource bundle with the >+ * given base name is requested >+ * @param basename the resource bundle's base name >+ * >+ * @return the localization context containing the resource bundle with >+ * the given base name and best matching locale, or <tt>null</tt> if no >+ * resource bundle match was found >+ */ >+ > private static LocalizationContext findMatch(PageContext pageContext, >- String basename) { >- LocalizationContext locCtxt = null; >- >- // Determine locale from client's browser settings. >- >- for (Enumeration enum_ = Util.getRequestLocales((HttpServletRequest)pageContext.getRequest()); >- enum_.hasMoreElements(); ) { >- Locale pref = (Locale) enum_.nextElement(); >- ResourceBundle match = findMatch(basename, pref); >- if (match != null) { >- locCtxt = new LocalizationContext(match, pref); >- break; >- } >- } >- >- return locCtxt; >+ String basename) { >+ LocalizationContext locCtxt = null; >+ >+ // Determine locale from client's browser settings. >+ >+ for (Enumeration enum_ = Util.getRequestLocales((HttpServletRequest) pageContext.getRequest()); >+ enum_.hasMoreElements();) { >+ Locale pref = (Locale) enum_.nextElement(); >+ ResourceBundle match = findMatch(basename, pref); >+ if (match != null) { >+ locCtxt = new LocalizationContext(match, pref); >+ break; >+ } >+ } >+ >+ return locCtxt; > } > > /* >@@ -279,17 +280,18 @@ > * language-match between the preferred locale and the locale of > * the bundle returned by java.util.ResourceBundle.getBundle(). > */ >+ > private static ResourceBundle findMatch(String basename, Locale pref) { >- ResourceBundle match = null; >+ ResourceBundle match = null; > >- try { >- ClassLoader cl = getClassLoaderCheckingPrivilege(); >- ResourceBundle bundle = ResourceBundle.getBundle(basename, pref, cl); >- Locale avail = bundle.getLocale(); >- if (pref.equals(avail)) { >- // Exact match >- match = bundle; >- } else { >+ try { >+ ClassLoader cl = getClassLoaderCheckingPrivilege(); >+ ResourceBundle bundle = ResourceBundle.getBundle(basename, pref, cl); >+ Locale avail = bundle.getLocale(); >+ if (pref.equals(avail)) { >+ // Exact match >+ match = bundle; >+ } else { > /* > * We have to make sure that the match we got is for > * the specified locale. The way ResourceBundle.getBundle() >@@ -303,33 +305,33 @@ > * - avail locale must be equal to preferred locale > * - avail country must be empty or equal to preferred country > * (the equality match might have failed on the variant) >- */ >+ */ > if (pref.getLanguage().equals(avail.getLanguage()) >- && ("".equals(avail.getCountry()) || pref.getCountry().equals(avail.getCountry()))) { >- /* >- * Language match. >- * By making sure the available locale does not have a >- * country and matches the preferred locale's language, we >- * rule out "matches" based on the container's default >- * locale. For example, if the preferred locale is >- * "en-US", the container's default locale is "en-UK", and >- * there is a resource bundle (with the requested base >- * name) available for "en-UK", ResourceBundle.getBundle() >- * will return it, but even though its language matches >- * that of the preferred locale, we must ignore it, >- * because matches based on the container's default locale >- * are not portable across different containers with >- * different default locales. >- */ >- match = bundle; >- } >- } >- } catch (MissingResourceException mre) { >- } >+ && ("".equals(avail.getCountry()) || pref.getCountry().equals(avail.getCountry()))) { >+ /* >+ * Language match. >+ * By making sure the available locale does not have a >+ * country and matches the preferred locale's language, we >+ * rule out "matches" based on the container's default >+ * locale. For example, if the preferred locale is >+ * "en-US", the container's default locale is "en-UK", and >+ * there is a resource bundle (with the requested base >+ * name) available for "en-UK", ResourceBundle.getBundle() >+ * will return it, but even though its language matches >+ * that of the preferred locale, we must ignore it, >+ * because matches based on the container's default locale >+ * are not portable across different containers with >+ * different default locales. >+ */ >+ match = bundle; >+ } >+ } >+ } catch (MissingResourceException mre) { >+ } > >- return match; >+ return match; > } >- >+ > private static ClassLoader getClassLoaderCheckingPrivilege() { > ClassLoader cl; > SecurityManager sm = System.getSecurityManager(); >@@ -337,8 +339,11 @@ > cl = Thread.currentThread().getContextClassLoader(); > } else { > cl = java.security.AccessController.doPrivileged( >- new java.security.PrivilegedAction<ClassLoader>() >- {public ClassLoader run() {return Thread.currentThread().getContextClassLoader();}}); >+ new java.security.PrivilegedAction<ClassLoader>() { >+ public ClassLoader run() { >+ return Thread.currentThread().getContextClassLoader(); >+ } >+ }); > } > return cl; > } >Index: src/main/java/org/apache/taglibs/standard/tag/common/fmt/TimeZoneSupport.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/fmt/TimeZoneSupport.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/fmt/TimeZoneSupport.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.fmt; > >@@ -41,8 +41,8 @@ > // Protected state > > protected Object value; // 'value' attribute >- > >+ > //********************************************************************* > // Private state > >@@ -53,12 +53,12 @@ > // Constructor and initialization > > public TimeZoneSupport() { >- super(); >- init(); >+ super(); >+ init(); > } > > private void init() { >- value = null; >+ value = null; > } > > >@@ -66,7 +66,7 @@ > // Collaboration with subtags > > public TimeZone getTimeZone() { >- return timeZone; >+ return timeZone; > } > > >@@ -76,36 +76,37 @@ > @Override > public int doStartTag() throws JspException { > >- if (value == null) { >- timeZone = TimeZone.getTimeZone("GMT"); >- } else if (value instanceof String) { >- if (((String) value).trim().equals("")) { >- timeZone = TimeZone.getTimeZone("GMT"); >- } else { >- timeZone = TimeZone.getTimeZone((String) value); >- } >- } else { >- timeZone = (TimeZone) value; >- } >+ if (value == null) { >+ timeZone = TimeZone.getTimeZone("GMT"); >+ } else if (value instanceof String) { >+ if (((String) value).trim().equals("")) { >+ timeZone = TimeZone.getTimeZone("GMT"); >+ } else { >+ timeZone = TimeZone.getTimeZone((String) value); >+ } >+ } else { >+ timeZone = (TimeZone) value; >+ } > >- return EVAL_BODY_BUFFERED; >+ return EVAL_BODY_BUFFERED; > } > > @Override > public int doEndTag() throws JspException { >- try { >- pageContext.getOut().print(bodyContent.getString()); >- } catch (IOException ioe) { >- throw new JspTagException(ioe.toString(), ioe); >- } >+ try { >+ pageContext.getOut().print(bodyContent.getString()); >+ } catch (IOException ioe) { >+ throw new JspTagException(ioe.toString(), ioe); >+ } > >- return EVAL_PAGE; >+ return EVAL_PAGE; > } > > // Releases any resources we may have (or inherit) >+ > @Override > public void release() { >- init(); >+ init(); > } > > >@@ -131,26 +132,27 @@ > * nested inside a <timeZone> action and no time zone configuration > * setting exists > */ >+ > static TimeZone getTimeZone(PageContext pc, Tag fromTag) { >- TimeZone tz = null; >+ TimeZone tz = null; > >- Tag t = findAncestorWithClass(fromTag, TimeZoneSupport.class); >- if (t != null) { >- // use time zone from parent <timeZone> tag >- TimeZoneSupport parent = (TimeZoneSupport) t; >- tz = parent.getTimeZone(); >- } else { >- // get time zone from configuration setting >- Object obj = Config.find(pc, Config.FMT_TIME_ZONE); >- if (obj != null) { >- if (obj instanceof TimeZone) { >- tz = (TimeZone) obj; >- } else { >- tz = TimeZone.getTimeZone((String) obj); >- } >- } >- } >+ Tag t = findAncestorWithClass(fromTag, TimeZoneSupport.class); >+ if (t != null) { >+ // use time zone from parent <timeZone> tag >+ TimeZoneSupport parent = (TimeZoneSupport) t; >+ tz = parent.getTimeZone(); >+ } else { >+ // get time zone from configuration setting >+ Object obj = Config.find(pc, Config.FMT_TIME_ZONE); >+ if (obj != null) { >+ if (obj instanceof TimeZone) { >+ tz = (TimeZone) obj; >+ } else { >+ tz = TimeZone.getTimeZone((String) obj); >+ } >+ } >+ } > >- return tz; >+ return tz; > } > } >Index: src/main/java/org/apache/taglibs/standard/tag/common/fmt/SetLocaleSupport.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/fmt/SetLocaleSupport.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/fmt/SetLocaleSupport.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.fmt; > >@@ -44,7 +44,7 @@ > > public abstract class SetLocaleSupport extends TagSupport { > >- >+ > //********************************************************************* > // Private constants > >@@ -69,21 +69,21 @@ > // Constructor and initialization > > public SetLocaleSupport() { >- super(); >- init(); >+ super(); >+ init(); > } > > private void init() { >- value = variant = null; >- scope = PageContext.PAGE_SCOPE; >+ value = variant = null; >+ scope = PageContext.PAGE_SCOPE; > } > > >- //********************************************************************* >+ //********************************************************************* > // Tag attributes known at translation time > > public void setScope(String scope) { >- this.scope = Util.getScope(scope); >+ this.scope = Util.getScope(scope); > } > > >@@ -92,30 +92,31 @@ > > @Override > public int doEndTag() throws JspException { >- Locale locale = null; >+ Locale locale = null; > >- if (value == null) { >- locale = Locale.getDefault(); >- } else if (value instanceof String) { >- if (((String) value).trim().equals("")) { >- locale = Locale.getDefault(); >- } else { >- locale = parseLocale((String) value, variant); >- } >- } else { >- locale = (Locale) value; >- } >+ if (value == null) { >+ locale = Locale.getDefault(); >+ } else if (value instanceof String) { >+ if (((String) value).trim().equals("")) { >+ locale = Locale.getDefault(); >+ } else { >+ locale = parseLocale((String) value, variant); >+ } >+ } else { >+ locale = (Locale) value; >+ } > >- Config.set(pageContext, Config.FMT_LOCALE, locale, scope); >- setResponseLocale(pageContext, locale); >+ Config.set(pageContext, Config.FMT_LOCALE, locale, scope); >+ setResponseLocale(pageContext, locale); > >- return EVAL_PAGE; >+ return EVAL_PAGE; > } > > // Releases any resources we may have (or inherit) >+ > @Override > public void release() { >- init(); >+ init(); > } > > >@@ -126,61 +127,61 @@ > * See parseLocale(String, String) for details. > */ > public static Locale parseLocale(String locale) { >- return parseLocale(locale, null); >+ return parseLocale(locale, null); > } > > /** > * Parses the given locale string into its language and (optionally) > * country components, and returns the corresponding > * <tt>java.util.Locale</tt> object. >- * >+ * <p/> > * If the given locale string is null or empty, the runtime's default > * locale is returned. > * >- * @param locale the locale string to parse >+ * @param locale the locale string to parse > * @param variant the variant >- * > * @return <tt>java.util.Locale</tt> object corresponding to the given >- * locale string, or the runtime's default locale if the locale string is >- * null or empty >- * >+ * locale string, or the runtime's default locale if the locale string is >+ * null or empty > * @throws IllegalArgumentException if the given locale does not have a >- * language component or has an empty country component >+ * language component or has an empty country component > */ > public static Locale parseLocale(String locale, String variant) { > >- Locale ret = null; >- String language = locale; >- String country = null; >- int index = -1; >+ Locale ret = null; >+ String language = locale; >+ String country = null; >+ int index = -1; > >- if (((index = locale.indexOf(HYPHEN)) > -1) >- || ((index = locale.indexOf(UNDERSCORE)) > -1)) { >- language = locale.substring(0, index); >- country = locale.substring(index+1); >- } >+ if (((index = locale.indexOf(HYPHEN)) > -1) >+ || ((index = locale.indexOf(UNDERSCORE)) > -1)) { >+ language = locale.substring(0, index); >+ country = locale.substring(index + 1); >+ } > >- if ((language == null) || (language.length() == 0)) { >- throw new IllegalArgumentException( >- Resources.getMessage("LOCALE_NO_LANGUAGE")); >- } >+ if ((language == null) || (language.length() == 0)) { >+ throw new IllegalArgumentException( >+ Resources.getMessage("LOCALE_NO_LANGUAGE")); >+ } > >- if (country == null) { >- if (variant != null) >- ret = new Locale(language, "", variant); >- else >- ret = new Locale(language, ""); >- } else if (country.length() > 0) { >- if (variant != null) >- ret = new Locale(language, country, variant); >- else >- ret = new Locale(language, country); >- } else { >- throw new IllegalArgumentException( >- Resources.getMessage("LOCALE_EMPTY_COUNTRY")); >- } >+ if (country == null) { >+ if (variant != null) { >+ ret = new Locale(language, "", variant); >+ } else { >+ ret = new Locale(language, ""); >+ } >+ } else if (country.length() > 0) { >+ if (variant != null) { >+ ret = new Locale(language, country, variant); >+ } else { >+ ret = new Locale(language, country); >+ } >+ } else { >+ throw new IllegalArgumentException( >+ Resources.getMessage("LOCALE_EMPTY_COUNTRY")); >+ } > >- return ret; >+ return ret; > } > > >@@ -201,95 +202,98 @@ > * the given locale > * @param locale the response locale > */ >+ > static void setResponseLocale(PageContext pc, Locale locale) { >- // set response locale >- ServletResponse response = pc.getResponse(); >- response.setLocale(locale); >- >- // get response character encoding and store it in session attribute >- if (pc.getSession() != null) { >+ // set response locale >+ ServletResponse response = pc.getResponse(); >+ response.setLocale(locale); >+ >+ // get response character encoding and store it in session attribute >+ if (pc.getSession() != null) { > try { >- pc.setAttribute(RequestEncodingSupport.REQUEST_CHAR_SET, >- response.getCharacterEncoding(), >- PageContext.SESSION_SCOPE); >- } catch (IllegalStateException ex) {} // invalidated session ignored >- } >+ pc.setAttribute(RequestEncodingSupport.REQUEST_CHAR_SET, >+ response.getCharacterEncoding(), >+ PageContext.SESSION_SCOPE); >+ } catch (IllegalStateException ex) { >+ } // invalidated session ignored >+ } > } >- >+ > /* >- * Returns the formatting locale to use with the given formatting action >- * in the given page. >- * >- * @param pc The page context containing the formatting action >- * @param fromTag The formatting action >- * @param format <tt>true</tt> if the formatting action is of type >- * <formatXXX> (as opposed to <parseXXX>), and <tt>false</tt> otherwise >- * (if set to <tt>true</tt>, the formatting locale that is returned by >- * this method is used to set the response locale). >- * >- * @param avail the array of available locales >- * >- * @return the formatting locale to use >- */ >+ * Returns the formatting locale to use with the given formatting action >+ * in the given page. >+ * >+ * @param pc The page context containing the formatting action >+ * @param fromTag The formatting action >+ * @param format <tt>true</tt> if the formatting action is of type >+ * <formatXXX> (as opposed to <parseXXX>), and <tt>false</tt> otherwise >+ * (if set to <tt>true</tt>, the formatting locale that is returned by >+ * this method is used to set the response locale). >+ * >+ * @param avail the array of available locales >+ * >+ * @return the formatting locale to use >+ */ >+ > static Locale getFormattingLocale(PageContext pc, >- Tag fromTag, >- boolean format, >- Locale[] avail) { >+ Tag fromTag, >+ boolean format, >+ Locale[] avail) { > >- LocalizationContext locCtxt = null; >- >- // Get formatting locale from enclosing <fmt:bundle> >- Tag parent = findAncestorWithClass(fromTag, BundleSupport.class); >- if (parent != null) { >- /* >- * use locale from localization context established by parent >- * <fmt:bundle> action, unless that locale is null >- */ >- locCtxt = ((BundleSupport) parent).getLocalizationContext(); >- if (locCtxt.getLocale() != null) { >- if (format) { >- setResponseLocale(pc, locCtxt.getLocale()); >- } >- return locCtxt.getLocale(); >- } >- } >+ LocalizationContext locCtxt = null; > >- // Use locale from default I18N localization context, unless it is null >- if ((locCtxt = BundleSupport.getLocalizationContext(pc)) != null) { >- if (locCtxt.getLocale() != null) { >- if (format) { >- setResponseLocale(pc, locCtxt.getLocale()); >- } >- return locCtxt.getLocale(); >- } >- } >+ // Get formatting locale from enclosing <fmt:bundle> >+ Tag parent = findAncestorWithClass(fromTag, BundleSupport.class); >+ if (parent != null) { >+ /* >+ * use locale from localization context established by parent >+ * <fmt:bundle> action, unless that locale is null >+ */ >+ locCtxt = ((BundleSupport) parent).getLocalizationContext(); >+ if (locCtxt.getLocale() != null) { >+ if (format) { >+ setResponseLocale(pc, locCtxt.getLocale()); >+ } >+ return locCtxt.getLocale(); >+ } >+ } > >- /* >- * Establish formatting locale by comparing the preferred locales >- * (in order of preference) against the available formatting >- * locales, and determining the best matching locale. >- */ >- Locale match = null; >- Locale pref = getLocale(pc, Config.FMT_LOCALE); >- if (pref != null) { >- // Preferred locale is application-based >- match = findFormattingMatch(pref, avail); >- } else { >- // Preferred locales are browser-based >- match = findFormattingMatch(pc, avail); >- } >- if (match == null) { >- //Use fallback locale. >- pref = getLocale(pc, Config.FMT_FALLBACK_LOCALE); >- if (pref != null) { >- match = findFormattingMatch(pref, avail); >- } >- } >- if (format && (match != null)) { >- setResponseLocale(pc, match); >- } >+ // Use locale from default I18N localization context, unless it is null >+ if ((locCtxt = BundleSupport.getLocalizationContext(pc)) != null) { >+ if (locCtxt.getLocale() != null) { >+ if (format) { >+ setResponseLocale(pc, locCtxt.getLocale()); >+ } >+ return locCtxt.getLocale(); >+ } >+ } > >- return match; >+ /* >+ * Establish formatting locale by comparing the preferred locales >+ * (in order of preference) against the available formatting >+ * locales, and determining the best matching locale. >+ */ >+ Locale match = null; >+ Locale pref = getLocale(pc, Config.FMT_LOCALE); >+ if (pref != null) { >+ // Preferred locale is application-based >+ match = findFormattingMatch(pref, avail); >+ } else { >+ // Preferred locales are browser-based >+ match = findFormattingMatch(pc, avail); >+ } >+ if (match == null) { >+ //Use fallback locale. >+ pref = getLocale(pc, Config.FMT_FALLBACK_LOCALE); >+ if (pref != null) { >+ match = findFormattingMatch(pref, avail); >+ } >+ } >+ if (format && (match != null)) { >+ setResponseLocale(pc, match); >+ } >+ >+ return match; > } > > /** >@@ -297,12 +301,13 @@ > * by getFormattingLocale(PageContext). > */ > static Locale[] availableFormattingLocales; >+ > static { > Locale[] dateLocales = DateFormat.getAvailableLocales(); > Locale[] numberLocales = NumberFormat.getAvailableLocales(); > Vector vec = new Vector(dateLocales.length); >- for (int i=0; i<dateLocales.length; i++) { >- for (int j=0; j<numberLocales.length; j++) { >+ for (int i = 0; i < dateLocales.length; i++) { >+ for (int j = 0; j < numberLocales.length; j++) { > if (dateLocales[i].equals(numberLocales[j])) { > vec.add(dateLocales[i]); > break; >@@ -310,48 +315,49 @@ > } > } > availableFormattingLocales = new Locale[vec.size()]; >- availableFormattingLocales = (Locale[])vec.toArray(availableFormattingLocales); >+ availableFormattingLocales = (Locale[]) vec.toArray(availableFormattingLocales); > /* > for (int i=0; i<availableFormattingLocales.length; i++) { > System.out.println("AvailableLocale[" + i + "] " + availableFormattingLocales[i]); > } > */ > } >- >+ > /* >- * Returns the formatting locale to use when <fmt:message> is used >- * with a locale-less localization context. >- * >- * @param pc The page context containing the formatting action >- * @return the formatting locale to use >- */ >+ * Returns the formatting locale to use when <fmt:message> is used >+ * with a locale-less localization context. >+ * >+ * @param pc The page context containing the formatting action >+ * @return the formatting locale to use >+ */ >+ > static Locale getFormattingLocale(PageContext pc) { >- /* >- * Establish formatting locale by comparing the preferred locales >- * (in order of preference) against the available formatting >- * locales, and determining the best matching locale. >- */ >- Locale match = null; >- Locale pref = getLocale(pc, Config.FMT_LOCALE); >- if (pref != null) { >- // Preferred locale is application-based >- match = findFormattingMatch(pref, availableFormattingLocales); >- } else { >- // Preferred locales are browser-based >- match = findFormattingMatch(pc, availableFormattingLocales); >- } >- if (match == null) { >- //Use fallback locale. >- pref = getLocale(pc, Config.FMT_FALLBACK_LOCALE); >- if (pref != null) { >- match = findFormattingMatch(pref, availableFormattingLocales); >- } >- } >- if (match != null) { >- setResponseLocale(pc, match); >- } >+ /* >+ * Establish formatting locale by comparing the preferred locales >+ * (in order of preference) against the available formatting >+ * locales, and determining the best matching locale. >+ */ >+ Locale match = null; >+ Locale pref = getLocale(pc, Config.FMT_LOCALE); >+ if (pref != null) { >+ // Preferred locale is application-based >+ match = findFormattingMatch(pref, availableFormattingLocales); >+ } else { >+ // Preferred locales are browser-based >+ match = findFormattingMatch(pc, availableFormattingLocales); >+ } >+ if (match == null) { >+ //Use fallback locale. >+ pref = getLocale(pc, Config.FMT_FALLBACK_LOCALE); >+ if (pref != null) { >+ match = findFormattingMatch(pref, availableFormattingLocales); >+ } >+ } >+ if (match != null) { >+ setResponseLocale(pc, match); >+ } > >- return match; >+ return match; > } > > /* >@@ -372,19 +378,20 @@ > * configuration parameter, or <tt>null</tt> if no scoped attribute or > * configuration parameter with the given name exists > */ >+ > static Locale getLocale(PageContext pageContext, String name) { >- Locale loc = null; >+ Locale loc = null; > >- Object obj = Config.find(pageContext, name); >- if (obj != null) { >- if (obj instanceof Locale) { >- loc = (Locale) obj; >- } else { >- loc = parseLocale((String) obj); >- } >- } >+ Object obj = Config.find(pageContext, name); >+ if (obj != null) { >+ if (obj instanceof Locale) { >+ loc = (Locale) obj; >+ } else { >+ loc = parseLocale((String) obj); >+ } >+ } > >- return loc; >+ return loc; > } > > >@@ -401,19 +408,20 @@ > * > * @return Best matching locale, or <tt>null</tt> if no match was found > */ >+ > private static Locale findFormattingMatch(PageContext pageContext, >- Locale[] avail) { >- Locale match = null; >- for (Enumeration enum_ = Util.getRequestLocales((HttpServletRequest)pageContext.getRequest()); >- enum_.hasMoreElements(); ) { >- Locale locale = (Locale)enum_.nextElement(); >- match = findFormattingMatch(locale, avail); >- if (match != null) { >- break; >- } >- } >- >- return match; >+ Locale[] avail) { >+ Locale match = null; >+ for (Enumeration enum_ = Util.getRequestLocales((HttpServletRequest) pageContext.getRequest()); >+ enum_.hasMoreElements();) { >+ Locale locale = (Locale) enum_.nextElement(); >+ match = findFormattingMatch(locale, avail); >+ if (match != null) { >+ break; >+ } >+ } >+ >+ return match; > } > > /* >@@ -435,32 +443,33 @@ > * @return Available locale that best matches the given preferred locale, > * or <tt>null</tt> if no match exists > */ >+ > private static Locale findFormattingMatch(Locale pref, Locale[] avail) { >- Locale match = null; >+ Locale match = null; > boolean langAndCountryMatch = false; >- for (int i=0; i<avail.length; i++) { >+ for (int i = 0; i < avail.length; i++) { > if (pref.equals(avail[i])) { > // Exact match > match = avail[i]; > break; > } else if ( > !"".equals(pref.getVariant()) && >- "".equals(avail[i].getVariant()) && >- pref.getLanguage().equals(avail[i].getLanguage()) && >- pref.getCountry().equals(avail[i].getCountry())) { >+ "".equals(avail[i].getVariant()) && >+ pref.getLanguage().equals(avail[i].getLanguage()) && >+ pref.getCountry().equals(avail[i].getCountry())) { > // Language and country match; different variant > match = avail[i]; > langAndCountryMatch = true; > } else if ( > !langAndCountryMatch && >- pref.getLanguage().equals(avail[i].getLanguage()) && >- ("".equals(avail[i].getCountry()))) { >+ pref.getLanguage().equals(avail[i].getLanguage()) && >+ ("".equals(avail[i].getCountry()))) { > // Language match > if (match == null) { > match = avail[i]; > } > } > } >- return match; >+ return match; > } > } >Index: src/main/java/org/apache/taglibs/standard/tag/common/fmt/RequestEncodingSupport.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/fmt/RequestEncodingSupport.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/fmt/RequestEncodingSupport.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.fmt; > >@@ -38,7 +38,7 @@ > // Package-scoped constants > > static final String REQUEST_CHAR_SET = >- "javax.servlet.jsp.jstl.fmt.request.charset"; >+ "javax.servlet.jsp.jstl.fmt.request.charset"; > > > //********************************************************************* >@@ -51,24 +51,24 @@ > // Tag attributes > > protected String value; // 'value' attribute >- > >+ > //********************************************************************* > // Derived information >- >+ > protected String charEncoding; // derived from 'value' attribute >- > >+ > //********************************************************************* > // Constructor and initialization > > public RequestEncodingSupport() { >- super(); >- init(); >+ super(); >+ init(); > } > > private void init() { >- value = null; >+ value = null; > } > > >@@ -78,36 +78,37 @@ > @Override > public int doEndTag() throws JspException { > charEncoding = value; >- if ((charEncoding == null) >- && (pageContext.getRequest().getCharacterEncoding() == null)) { >+ if ((charEncoding == null) >+ && (pageContext.getRequest().getCharacterEncoding() == null)) { > // Use charset from session-scoped attribute >- charEncoding = (String) >- pageContext.getAttribute(REQUEST_CHAR_SET, >- PageContext.SESSION_SCOPE); >- if (charEncoding == null) { >- // Use default encoding >- charEncoding = DEFAULT_ENCODING; >- } >- } >+ charEncoding = (String) >+ pageContext.getAttribute(REQUEST_CHAR_SET, >+ PageContext.SESSION_SCOPE); >+ if (charEncoding == null) { >+ // Use default encoding >+ charEncoding = DEFAULT_ENCODING; >+ } >+ } > >- /* >- * If char encoding was already set in the request, we don't need to >- * set it again. >- */ >- if (charEncoding != null) { >- try { >- pageContext.getRequest().setCharacterEncoding(charEncoding); >- } catch (UnsupportedEncodingException uee) { >- throw new JspTagException(uee.toString(), uee); >- } >- } >+ /* >+ * If char encoding was already set in the request, we don't need to >+ * set it again. >+ */ >+ if (charEncoding != null) { >+ try { >+ pageContext.getRequest().setCharacterEncoding(charEncoding); >+ } catch (UnsupportedEncodingException uee) { >+ throw new JspTagException(uee.toString(), uee); >+ } >+ } > >- return EVAL_PAGE; >+ return EVAL_PAGE; > } > > // Releases any resources we may have (or inherit) >+ > @Override > public void release() { >- init(); >+ init(); > } > } >Index: src/main/java/org/apache/taglibs/standard/tag/common/fmt/ParamSupport.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/fmt/ParamSupport.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/fmt/ParamSupport.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.fmt; > >@@ -29,8 +29,8 @@ > * subtag in JSTL 1.0 which supplies an argument for parametric replacement > * to its parent <message> tag. > * >+ * @author Jan Luehe > * @see MessageSupport >- * @author Jan Luehe > */ > > public abstract class ParamSupport extends BodyTagSupport { >@@ -39,20 +39,20 @@ > // Protected state > > protected Object value; // 'value' attribute >- protected boolean valueSpecified; // status >+ protected boolean valueSpecified; // status > > > //********************************************************************* > // Constructor and initialization > > public ParamSupport() { >- super(); >- init(); >+ super(); >+ init(); > } > > private void init() { >- value = null; >- valueSpecified = false; >+ value = null; >+ valueSpecified = false; > } > > >@@ -60,38 +60,40 @@ > // Tag logic > > // Supply our value to our parent <fmt:message> tag >+ > @Override > public int doEndTag() throws JspException { >- Tag t = findAncestorWithClass(this, MessageSupport.class); >- if (t == null) { >- throw new JspTagException(Resources.getMessage( >- "PARAM_OUTSIDE_MESSAGE")); >- } >- MessageSupport parent = (MessageSupport) t; >+ Tag t = findAncestorWithClass(this, MessageSupport.class); >+ if (t == null) { >+ throw new JspTagException(Resources.getMessage( >+ "PARAM_OUTSIDE_MESSAGE")); >+ } >+ MessageSupport parent = (MessageSupport) t; > >- /* >- * Get argument from 'value' attribute or body, as appropriate, and >- * add it to enclosing <fmt:message> tag, even if it is null or equal >- * to "". >- */ >- Object input = null; >+ /* >+ * Get argument from 'value' attribute or body, as appropriate, and >+ * add it to enclosing <fmt:message> tag, even if it is null or equal >+ * to "". >+ */ >+ Object input = null; > // determine the input by... >- if (valueSpecified) { >- // ... reading 'value' attribute >- input = value; >- } else { >- // ... retrieving and trimming our body (TLV has ensured that it's >- // non-empty) >- input = bodyContent.getString().trim(); >- } >- parent.addParam(input); >+ if (valueSpecified) { >+ // ... reading 'value' attribute >+ input = value; >+ } else { >+ // ... retrieving and trimming our body (TLV has ensured that it's >+ // non-empty) >+ input = bodyContent.getString().trim(); >+ } >+ parent.addParam(input); > >- return EVAL_PAGE; >+ return EVAL_PAGE; > } > > // Releases any resources we may have (or inherit) >+ > @Override > public void release() { >- init(); >+ init(); > } > } >Index: src/main/java/org/apache/taglibs/standard/tag/common/fmt/FormatNumberSupport.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/fmt/FormatNumberSupport.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/fmt/FormatNumberSupport.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.fmt; > >@@ -45,8 +45,8 @@ > // Private constants > > private static final Class[] GET_INSTANCE_PARAM_TYPES = >- new Class[] { String.class }; >- private static final String NUMBER = "number"; >+ new Class[]{String.class}; >+ private static final String NUMBER = "number"; > private static final String CURRENCY = "currency"; > private static final String PERCENT = "percent"; > >@@ -55,7 +55,7 @@ > // Protected state > > protected Object value; // 'value' attribute >- protected boolean valueSpecified; // status >+ protected boolean valueSpecified; // status > protected String type; // 'type' attribute > protected String pattern; // 'pattern' attribute > protected String currencyCode; // 'currencyCode' attribute >@@ -84,30 +84,30 @@ > // Constructor and initialization > > static { >- try { >- currencyClass = Class.forName("java.util.Currency"); >- // container's runtime is J2SE 1.4 or greater >- } catch (Exception cnfe) { >- } >+ try { >+ currencyClass = Class.forName("java.util.Currency"); >+ // container's runtime is J2SE 1.4 or greater >+ } catch (Exception cnfe) { >+ } > } > > public FormatNumberSupport() { >- super(); >- init(); >+ super(); >+ init(); > } > > private void init() { >- value = type = null; >- valueSpecified = false; >- pattern = var = currencyCode = currencySymbol = null; >- groupingUsedSpecified = false; >- maxIntegerDigitsSpecified = minIntegerDigitsSpecified = false; >- maxFractionDigitsSpecified = minFractionDigitsSpecified = false; >- scope = PageContext.PAGE_SCOPE; >+ value = type = null; >+ valueSpecified = false; >+ pattern = var = currencyCode = currencySymbol = null; >+ groupingUsedSpecified = false; >+ maxIntegerDigitsSpecified = minIntegerDigitsSpecified = false; >+ maxFractionDigitsSpecified = minFractionDigitsSpecified = false; >+ scope = PageContext.PAGE_SCOPE; > } > > >- //********************************************************************* >+ //********************************************************************* > // Tag attributes known at translation time > > public void setVar(String var) { >@@ -115,7 +115,7 @@ > } > > public void setScope(String scope) { >- this.scope = Util.getScope(scope); >+ this.scope = Util.getScope(scope); > } > > >@@ -124,98 +124,100 @@ > > @Override > public int doEndTag() throws JspException { >- String formatted = null; >+ String formatted = null; > Object input = null; > > // determine the input by... > if (valueSpecified) { >- // ... reading 'value' attribute >- input = value; >- } else { >- // ... retrieving and trimming our body >- if (bodyContent != null && bodyContent.getString() != null) >- input = bodyContent.getString().trim(); >- } >+ // ... reading 'value' attribute >+ input = value; >+ } else { >+ // ... retrieving and trimming our body >+ if (bodyContent != null && bodyContent.getString() != null) { >+ input = bodyContent.getString().trim(); >+ } >+ } > >- if ((input == null) || input.equals("")) { >- // Spec says: >+ if ((input == null) || input.equals("")) { >+ // 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); >+ if (var != null) { >+ pageContext.removeAttribute(var, scope); > } >- return EVAL_PAGE; >- } >+ return EVAL_PAGE; >+ } > >- /* >- * If 'value' is a String, it is first parsed into an instance of >- * java.lang.Number >- */ >- if (input instanceof String) { >- try { >- if (((String) input).indexOf('.') != -1) { >- input = Double.valueOf((String) input); >- } else { >- input = Long.valueOf((String) input); >- } >- } catch (NumberFormatException nfe) { >- throw new JspException( >- Resources.getMessage("FORMAT_NUMBER_PARSE_ERROR", input), >- nfe); >- } >- } >+ /* >+ * If 'value' is a String, it is first parsed into an instance of >+ * java.lang.Number >+ */ >+ if (input instanceof String) { >+ try { >+ if (((String) input).indexOf('.') != -1) { >+ input = Double.valueOf((String) input); >+ } else { >+ input = Long.valueOf((String) input); >+ } >+ } catch (NumberFormatException nfe) { >+ throw new JspException( >+ Resources.getMessage("FORMAT_NUMBER_PARSE_ERROR", input), >+ nfe); >+ } >+ } > >- // Determine formatting locale >- Locale loc = SetLocaleSupport.getFormattingLocale( >- pageContext, >- this, >- true, >- NumberFormat.getAvailableLocales()); >+ // Determine formatting locale >+ Locale loc = SetLocaleSupport.getFormattingLocale( >+ pageContext, >+ this, >+ true, >+ NumberFormat.getAvailableLocales()); > >- if (loc != null) { >- // Create formatter >- NumberFormat formatter = null; >- if ((pattern != null) && !pattern.equals("")) { >- // if 'pattern' is specified, 'type' is ignored >- DecimalFormatSymbols symbols = new DecimalFormatSymbols(loc); >- formatter = new DecimalFormat(pattern, symbols); >- } else { >- formatter = createFormatter(loc); >- } >- if (((pattern != null) && !pattern.equals("")) >- || CURRENCY.equalsIgnoreCase(type)) { >- try { >- setCurrency(formatter); >- } catch (Exception e) { >- throw new JspException( >- Resources.getMessage("FORMAT_NUMBER_CURRENCY_ERROR"), >- e); >- } >- } >- configureFormatter(formatter); >- formatted = formatter.format(input); >- } else { >- // no formatting locale available, use toString() >- formatted = input.toString(); >- } >+ if (loc != null) { >+ // Create formatter >+ NumberFormat formatter = null; >+ if ((pattern != null) && !pattern.equals("")) { >+ // if 'pattern' is specified, 'type' is ignored >+ DecimalFormatSymbols symbols = new DecimalFormatSymbols(loc); >+ formatter = new DecimalFormat(pattern, symbols); >+ } else { >+ formatter = createFormatter(loc); >+ } >+ if (((pattern != null) && !pattern.equals("")) >+ || CURRENCY.equalsIgnoreCase(type)) { >+ try { >+ setCurrency(formatter); >+ } catch (Exception e) { >+ throw new JspException( >+ Resources.getMessage("FORMAT_NUMBER_CURRENCY_ERROR"), >+ e); >+ } >+ } >+ configureFormatter(formatter); >+ formatted = formatter.format(input); >+ } else { >+ // no formatting locale available, use toString() >+ formatted = input.toString(); >+ } > >- if (var != null) { >- pageContext.setAttribute(var, formatted, scope); >- } else { >- try { >- pageContext.getOut().print(formatted); >- } catch (IOException ioe) { >- throw new JspTagException(ioe.toString(), ioe); >- } >- } >+ if (var != null) { >+ pageContext.setAttribute(var, formatted, scope); >+ } else { >+ try { >+ pageContext.getOut().print(formatted); >+ } catch (IOException ioe) { >+ throw new JspTagException(ioe.toString(), ioe); >+ } >+ } > >- return EVAL_PAGE; >+ return EVAL_PAGE; > } > > // Releases any resources we may have (or inherit) >+ > @Override > public void release() { >- init(); >+ init(); > } > > >@@ -223,20 +225,20 @@ > // Private utility methods > > private NumberFormat createFormatter(Locale loc) throws JspException { >- NumberFormat formatter = null; >- >- if ((type == null) || NUMBER.equalsIgnoreCase(type)) { >- formatter = NumberFormat.getNumberInstance(loc); >- } else if (CURRENCY.equalsIgnoreCase(type)) { >- formatter = NumberFormat.getCurrencyInstance(loc); >- } else if (PERCENT.equalsIgnoreCase(type)) { >- formatter = NumberFormat.getPercentInstance(loc); >- } else { >- throw new JspException( >- Resources.getMessage("FORMAT_NUMBER_INVALID_TYPE", type)); >- } >- >- return formatter; >+ NumberFormat formatter = null; >+ >+ if ((type == null) || NUMBER.equalsIgnoreCase(type)) { >+ formatter = NumberFormat.getNumberInstance(loc); >+ } else if (CURRENCY.equalsIgnoreCase(type)) { >+ formatter = NumberFormat.getCurrencyInstance(loc); >+ } else if (PERCENT.equalsIgnoreCase(type)) { >+ formatter = NumberFormat.getPercentInstance(loc); >+ } else { >+ throw new JspException( >+ Resources.getMessage("FORMAT_NUMBER_INVALID_TYPE", type)); >+ } >+ >+ return formatter; > } > > /* >@@ -244,17 +246,23 @@ > * 'maxFractionDigits', and 'minFractionDigits' attributes to the given > * formatter. > */ >+ > private void configureFormatter(NumberFormat formatter) { >- if (groupingUsedSpecified) >- formatter.setGroupingUsed(isGroupingUsed); >- if (maxIntegerDigitsSpecified) >- formatter.setMaximumIntegerDigits(maxIntegerDigits); >- if (minIntegerDigitsSpecified) >- formatter.setMinimumIntegerDigits(minIntegerDigits); >- if (maxFractionDigitsSpecified) >- formatter.setMaximumFractionDigits(maxFractionDigits); >- if (minFractionDigitsSpecified) >- formatter.setMinimumFractionDigits(minFractionDigits); >+ if (groupingUsedSpecified) { >+ formatter.setGroupingUsed(isGroupingUsed); >+ } >+ if (maxIntegerDigitsSpecified) { >+ formatter.setMaximumIntegerDigits(maxIntegerDigits); >+ } >+ if (minIntegerDigitsSpecified) { >+ formatter.setMinimumIntegerDigits(minIntegerDigits); >+ } >+ if (maxFractionDigitsSpecified) { >+ formatter.setMaximumFractionDigits(maxFractionDigits); >+ } >+ if (minFractionDigitsSpecified) { >+ formatter.setMinimumFractionDigits(minFractionDigits); >+ } > } > > /* >@@ -285,57 +293,60 @@ > * <1.4 EUR \u20AC \u20AC > * >=1.4 EUR \u20AC Locale's currency symbol for Euro > */ >+ > private void setCurrency(NumberFormat formatter) throws Exception { >- String code = null; >- String symbol = null; >+ String code = null; >+ String symbol = null; > >- if ((currencyCode == null) && (currencySymbol == null)) { >- return; >- } >+ if ((currencyCode == null) && (currencySymbol == null)) { >+ return; >+ } > >- if ((currencyCode != null) && (currencySymbol != null)) { >- if (currencyClass != null) >- code = currencyCode; >- else >- symbol = currencySymbol; >- } else if (currencyCode == null) { >- symbol = currencySymbol; >- } else { >- if (currencyClass != null) >- code = currencyCode; >- else >- symbol = currencyCode; >- } >+ if ((currencyCode != null) && (currencySymbol != null)) { >+ if (currencyClass != null) { >+ code = currencyCode; >+ } else { >+ symbol = currencySymbol; >+ } >+ } else if (currencyCode == null) { >+ symbol = currencySymbol; >+ } else { >+ if (currencyClass != null) { >+ code = currencyCode; >+ } else { >+ symbol = currencyCode; >+ } >+ } > >- if (code != null) { >- Object[] methodArgs = new Object[1]; >+ if (code != null) { >+ Object[] methodArgs = new Object[1]; > >- /* >- * java.util.Currency.getInstance() >- */ >- Method m = currencyClass.getMethod("getInstance", >- GET_INSTANCE_PARAM_TYPES); >- methodArgs[0] = code; >- Object currency = m.invoke(null, methodArgs); >+ /* >+ * java.util.Currency.getInstance() >+ */ >+ Method m = currencyClass.getMethod("getInstance", >+ GET_INSTANCE_PARAM_TYPES); >+ methodArgs[0] = code; >+ Object currency = m.invoke(null, methodArgs); > >- /* >- * java.text.NumberFormat.setCurrency() >- */ >- Class[] paramTypes = new Class[1]; >- paramTypes[0] = currencyClass; >- Class numberFormatClass = Class.forName("java.text.NumberFormat"); >- m = numberFormatClass.getMethod("setCurrency", paramTypes); >- methodArgs[0] = currency; >- m.invoke(formatter, methodArgs); >- } else { >- /* >- * Let potential ClassCastException propagate up (will almost >- * never happen) >- */ >- DecimalFormat df = (DecimalFormat) formatter; >- DecimalFormatSymbols dfs = df.getDecimalFormatSymbols(); >- dfs.setCurrencySymbol(symbol); >- df.setDecimalFormatSymbols(dfs); >- } >+ /* >+ * java.text.NumberFormat.setCurrency() >+ */ >+ Class[] paramTypes = new Class[1]; >+ paramTypes[0] = currencyClass; >+ Class numberFormatClass = Class.forName("java.text.NumberFormat"); >+ m = numberFormatClass.getMethod("setCurrency", paramTypes); >+ methodArgs[0] = currency; >+ m.invoke(formatter, methodArgs); >+ } else { >+ /* >+ * Let potential ClassCastException propagate up (will almost >+ * never happen) >+ */ >+ DecimalFormat df = (DecimalFormat) formatter; >+ DecimalFormatSymbols dfs = df.getDecimalFormatSymbols(); >+ dfs.setCurrencySymbol(symbol); >+ df.setDecimalFormatSymbols(dfs); >+ } > } > } >Index: src/main/java/org/apache/taglibs/standard/tag/common/core/UrlSupport.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/core/UrlSupport.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/core/UrlSupport.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.core; > >@@ -34,38 +34,38 @@ > */ > > public abstract class UrlSupport extends BodyTagSupport >- implements ParamParent { >+ implements ParamParent { > > //********************************************************************* > // Protected state > > protected String value; // 'value' attribute >- protected String context; // 'context' attribute >+ protected String context; // 'context' attribute > > //********************************************************************* > // Private state > > private String var; // 'var' attribute >- private int scope; // processed 'scope' attr >- private ParamSupport.ParamManager params; // added parameters >+ private int scope; // processed 'scope' attr >+ private ParamSupport.ParamManager params; // added parameters > > //********************************************************************* > // Constructor and initialization > > public UrlSupport() { >- super(); >- init(); >+ super(); >+ init(); > } > > private void init() { >- value = var = null; >- params = null; >- context = null; >- scope = PageContext.PAGE_SCOPE; >+ value = var = null; >+ params = null; >+ context = null; >+ scope = PageContext.PAGE_SCOPE; > } > > >- //********************************************************************* >+ //********************************************************************* > // Tag attributes known at translation time > > public void setVar(String var) { >@@ -73,7 +73,7 @@ > } > > public void setScope(String scope) { >- this.scope = Util.getScope(scope); >+ this.scope = Util.getScope(scope); > } > > >@@ -81,8 +81,9 @@ > // Collaboration with subtags > > // inherit Javadoc >+ > public void addParameter(String name, String value) { >- params.addParameter(name, value); >+ params.addParameter(name, value); > } > > >@@ -90,47 +91,50 @@ > // Tag logic > > // resets any parameters that might be sent >+ > @Override > public int doStartTag() throws JspException { >- params = new ParamSupport.ParamManager(); >- return EVAL_BODY_BUFFERED; >+ params = new ParamSupport.ParamManager(); >+ return EVAL_BODY_BUFFERED; > } > > > // gets the right value, encodes it, and prints or stores it >+ > @Override > public int doEndTag() throws JspException { >- String result; // the eventual result >+ String result; // the eventual result > >- // add (already encoded) parameters >- String baseUrl = resolveUrl(value, context, pageContext); >- result = params.aggregateParams(baseUrl); >+ // add (already encoded) parameters >+ String baseUrl = resolveUrl(value, context, pageContext); >+ result = params.aggregateParams(baseUrl); > >- // if the URL is relative, rewrite it >- if (!ImportSupport.isAbsoluteUrl(result)) { >- HttpServletResponse response = >- ((HttpServletResponse) pageContext.getResponse()); >+ // if the URL is relative, rewrite it >+ if (!ImportSupport.isAbsoluteUrl(result)) { >+ HttpServletResponse response = >+ ((HttpServletResponse) pageContext.getResponse()); > result = response.encodeURL(result); >- } >+ } > >- // store or print the output >- if (var != null) >- pageContext.setAttribute(var, result, scope); >- else { >- try { >- pageContext.getOut().print(result); >- } catch (java.io.IOException ex) { >- throw new JspTagException(ex.toString(), ex); >- } >- } >+ // store or print the output >+ if (var != null) { >+ pageContext.setAttribute(var, result, scope); >+ } else { >+ try { >+ pageContext.getOut().print(result); >+ } catch (java.io.IOException ex) { >+ throw new JspTagException(ex.toString(), ex); >+ } >+ } > >- return EVAL_PAGE; >+ return EVAL_PAGE; > } > > // Releases any resources we may have (or inherit) >+ > @Override > public void release() { >- init(); >+ init(); > } > > //********************************************************************* >@@ -138,23 +142,25 @@ > > public static String resolveUrl( > String url, String context, PageContext pageContext) >- throws JspException { >- // don't touch absolute URLs >- if (ImportSupport.isAbsoluteUrl(url)) >- return url; >+ throws JspException { >+ // don't touch absolute URLs >+ if (ImportSupport.isAbsoluteUrl(url)) { >+ return url; >+ } > >- // normalize relative URLs against a context root >- HttpServletRequest request = >- (HttpServletRequest) pageContext.getRequest(); >- if (context == null) { >- if (url.startsWith("/")) >- return (request.getContextPath() + url); >- else >- return url; >- } else { >+ // normalize relative URLs against a context root >+ HttpServletRequest request = >+ (HttpServletRequest) pageContext.getRequest(); >+ if (context == null) { >+ if (url.startsWith("/")) { >+ return (request.getContextPath() + url); >+ } else { >+ return url; >+ } >+ } else { > if (!context.startsWith("/") || !url.startsWith("/")) { > throw new JspTagException( >- Resources.getMessage("IMPORT_BAD_RELATIVE")); >+ Resources.getMessage("IMPORT_BAD_RELATIVE")); > } > if (context.endsWith("/") && url.startsWith("/")) { > // Don't produce string starting with '//', many >Index: src/main/java/org/apache/taglibs/standard/tag/common/core/OutSupport.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/core/OutSupport.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/core/OutSupport.java (working copy) >@@ -13,18 +13,18 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.core; > >-import org.apache.taglibs.standard.util.EscapeXML; >- > import java.io.IOException; > > import javax.servlet.jsp.JspException; > import javax.servlet.jsp.JspTagException; > import javax.servlet.jsp.tagext.BodyTagSupport; > >+import org.apache.taglibs.standard.util.EscapeXML; >+ > /** > * <p>Support for handlers of the <out> tag, which simply evalutes and > * prints the result of the expression it's passed. If the result is >@@ -59,6 +59,7 @@ > } > > // Releases any resources we may have (or inherit) >+ > @Override > public void release() { > output = null; >@@ -82,7 +83,7 @@ > > // output default if supplied > output = evalDefault(); >- if (output != null ) { >+ if (output != null) { > return SKIP_BODY; > } > >Index: src/main/java/org/apache/taglibs/standard/tag/common/core/ForEachSupport.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/core/ForEachSupport.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/core/ForEachSupport.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.core; > >@@ -40,15 +40,15 @@ > * ForEach-specific functionality. The rtexprvalue library and the > * expression-evaluating library each have handlers that extend this > * class.</p> >- * >+ * <p/> > * <p>Localized here is the logic for handling the veritable smorgasbord > * of types supported by <forEach>, including arrays, > * Collections, and others. To see how the actual iteration is controlled, > * review the javax.servlet.jsp.jstl.core.LoopTagSupport class instead. > * </p> > * >+ * @author Shawn Bayern > * @see javax.servlet.jsp.jstl.core.LoopTagSupport >- * @author Shawn Bayern > */ > > public abstract class ForEachSupport extends LoopTagSupport { >@@ -92,8 +92,10 @@ > * instead of in advance, would involve changing only those methods that > * handle primitive arrays. > */ >+ > protected static interface ForEachIterator { > public boolean hasNext() throws JspTagException; >+ > public Object next() throws JspTagException; > } > >@@ -102,19 +104,23 @@ > * an Iterator. This is appropriate for cases where hasNext() and > * next() don't need to throw JspTagException. Such cases are common.core. > */ >+ > protected class SimpleForEachIterator implements ForEachIterator { > private Iterator i; >+ > public SimpleForEachIterator(Iterator i) { > this.i = i; > } >+ > public boolean hasNext() { > return i.hasNext(); > } >+ > public Object next() { > return i.next(); > } > } >- >+ > protected class DeferredForEachIterator implements ForEachIterator { > > private ValueExpression itemsValueExpression; >@@ -126,21 +132,23 @@ > private Iterator myIterator; > private boolean anEnumeration = false; > private Enumeration myEnumeration; >+ > public DeferredForEachIterator(ValueExpression o) throws JspTagException { > itemsValueExpression = o; > determineLengthAndType(); > } >+ > public boolean hasNext() throws JspTagException { > if (isIndexedValueExpression) { >- if (currentIndex<length) { >+ if (currentIndex < length) { > return true; > } else { > return false; >- } >+ } > } else { >- if (length!=-1) { >+ if (length != -1) { > //a Collection, Map, or StringTokenizer >- if (currentIndex<length) { >+ if (currentIndex < length) { > return true; > } else { > return false; >@@ -157,18 +165,19 @@ > } > } > } >+ > public Object next() throws JspTagException { > ValueExpression nextValue = null; > if (isIndexedValueExpression) { > nextValue = new IndexedValueExpression(itemsValueExpression, currentIndex); > currentIndex++; > } else { >- if (itemsValueIteratedExpression==null) { >+ if (itemsValueIteratedExpression == null) { > itemsValueIteratedExpression = new IteratedExpression(itemsValueExpression, getDelims()); > } > nextValue = new IteratedValueExpression(itemsValueIteratedExpression, currentIndex); > currentIndex++; >- if (length!=-1) { >+ if (length != -1) { > //a Collection, Map, or StringTokenizer > //nothing else needed > } else { >@@ -182,57 +191,58 @@ > } > return nextValue; > } >+ > private void determineLengthAndType() throws JspTagException { > ELContext myELContext = pageContext.getELContext(); > Object o = itemsValueExpression.getValue(myELContext); > if (o instanceof Object[]) { >- length = ((Object[])o).length; >+ length = ((Object[]) o).length; > isIndexedValueExpression = true; > } else if (o instanceof boolean[]) { >- length = ((boolean[])o).length; >+ length = ((boolean[]) o).length; > isIndexedValueExpression = true; > } else if (o instanceof byte[]) { >- length = ((byte[])o).length; >+ length = ((byte[]) o).length; > isIndexedValueExpression = true; > } else if (o instanceof char[]) { >- length = ((char[])o).length; >+ length = ((char[]) o).length; > isIndexedValueExpression = true; > } else if (o instanceof short[]) { >- length = ((short[])o).length; >+ length = ((short[]) o).length; > isIndexedValueExpression = true; > } else if (o instanceof int[]) { >- length = ((int[])o).length; >+ length = ((int[]) o).length; > isIndexedValueExpression = true; > } else if (o instanceof long[]) { >- length = ((long[])o).length; >+ length = ((long[]) o).length; > isIndexedValueExpression = true; > } else if (o instanceof float[]) { >- length = ((float[])o).length; >+ length = ((float[]) o).length; > isIndexedValueExpression = true; > } else if (o instanceof double[]) { >- length = ((double[])o).length; >+ length = ((double[]) o).length; > isIndexedValueExpression = true; > } else if (o instanceof Collection) { >- length = ((Collection)o).size(); >+ length = ((Collection) o).size(); > isIndexedValueExpression = false; > } else if (o instanceof Iterator) { > //have to reproduce iterator here so we can determine the size > isIndexedValueExpression = false; > anIterator = true; >- myIterator = (Iterator)o; >+ myIterator = (Iterator) o; > } else if (o instanceof Enumeration) { > isIndexedValueExpression = false; >- anEnumeration=true; >- myEnumeration = (Enumeration)o; >+ anEnumeration = true; >+ myEnumeration = (Enumeration) o; > } else if (o instanceof Map) { >- length = ((Map)o).size(); >+ length = ((Map) o).size(); > isIndexedValueExpression = false; >- // >- //else if (o instanceof ResultSet) >- // items = toForEachIterator((ResultSet) o); >- // >+ // >+ //else if (o instanceof ResultSet) >+ // items = toForEachIterator((ResultSet) o); >+ // > } else if (o instanceof String) { >- StringTokenizer st = new StringTokenizer((String)o, ","); >+ StringTokenizer st = new StringTokenizer((String) o, ","); > length = st.countTokens(); > isIndexedValueExpression = false; > } else { >@@ -269,7 +279,7 @@ > // produce the right sort of ForEachIterator > if (rawItems != null) { > if (rawItems instanceof ValueExpression) { >- deferredExpression = (ValueExpression)rawItems; >+ deferredExpression = (ValueExpression) rawItems; > items = toDeferredForEachIterator(deferredExpression); > } else { > // extract an iterator over the 'items' we've got >@@ -283,8 +293,7 @@ > /* ResultSet no more supported in <c:forEach> > // step must be 1 when ResultSet is passed in > if (rawItems instanceof ResultSet && step != 1) >- throw new JspTagException( >- Resources.getMessage("FOREACH_STEP_NO_RESULTSET")); >+ throw new JspTagException(Resources.getMessage("FOREACH_STEP_NO_RESULTSET")); > */ > } > >@@ -293,6 +302,7 @@ > // Tag logic and lifecycle management > > // Releases any resources we may have (or inherit) >+ > @Override > public void release() { > super.release(); >@@ -306,6 +316,7 @@ > > /* Extracts a ForEachIterator given an object of a supported type. */ > //This should not be called for a deferred ValueExpression >+ > protected ForEachIterator supportedTypeForEachIterator(Object o) > throws JspTagException { > >@@ -325,40 +336,42 @@ > > ForEachIterator items; > >- if (o instanceof Object[]) >+ if (o instanceof Object[]) { > items = toForEachIterator((Object[]) o); >- else if (o instanceof boolean[]) >+ } else if (o instanceof boolean[]) { > items = toForEachIterator((boolean[]) o); >- else if (o instanceof byte[]) >+ } else if (o instanceof byte[]) { > items = toForEachIterator((byte[]) o); >- else if (o instanceof char[]) >+ } else if (o instanceof char[]) { > items = toForEachIterator((char[]) o); >- else if (o instanceof short[]) >+ } else if (o instanceof short[]) { > items = toForEachIterator((short[]) o); >- else if (o instanceof int[]) >+ } else if (o instanceof int[]) { > items = toForEachIterator((int[]) o); >- else if (o instanceof long[]) >+ } else if (o instanceof long[]) { > items = toForEachIterator((long[]) o); >- else if (o instanceof float[]) >+ } else if (o instanceof float[]) { > items = toForEachIterator((float[]) o); >- else if (o instanceof double[]) >+ } else if (o instanceof double[]) { > items = toForEachIterator((double[]) o); >- else if (o instanceof Collection) >+ } else if (o instanceof Collection) { > items = toForEachIterator((Collection) o); >- else if (o instanceof Iterator) >+ } else if (o instanceof Iterator) { > items = toForEachIterator((Iterator) o); >- else if (o instanceof Enumeration) >+ } else if (o instanceof Enumeration) { > items = toForEachIterator((Enumeration) o); >- else if (o instanceof Map) >+ } else if (o instanceof Map) { > items = toForEachIterator((Map) o); >+ } > /* > else if (o instanceof ResultSet) > items = toForEachIterator((ResultSet) o); > */ >- else if (o instanceof String) >+ else if (o instanceof String) { > items = toForEachIterator((String) o); >- else >+ } else { > items = toForEachIterator(o); >+ } > > return (items); > } >@@ -368,6 +381,7 @@ > * in support of cases where our tag handler isn't passed an > * explicit collection over which to iterate. > */ >+ > private ForEachIterator beginEndForEachIterator() { > /* > * To plug into existing support, we need to keep 'begin', 'end', >@@ -382,8 +396,9 @@ > * wouldn't provide much benefit.) > */ > Integer[] ia = new Integer[end + 1]; >- for (int i = 0; i <= end; i++) >+ for (int i = 0; i <= end; i++) { > ia[i] = new Integer(i); >+ } > return new SimpleForEachIterator(Arrays.asList(ia).iterator()); > } > >@@ -394,19 +409,22 @@ > protected ForEachIterator toDeferredForEachIterator(ValueExpression o) throws JspTagException { > return new DeferredForEachIterator(o); > } >- >+ > // catch-all method whose invocation currently signals a 'matching error' >+ > protected ForEachIterator toForEachIterator(Object o) > throws JspTagException { > throw new JspTagException(Resources.getMessage("FOREACH_BAD_ITEMS")); > } > > // returns an iterator over an Object array (via List) >+ > protected ForEachIterator toForEachIterator(Object[] a) { > return new SimpleForEachIterator(Arrays.asList(a).iterator()); > } > > // returns an iterator over a boolean[] array, wrapping items in Boolean >+ > protected ForEachIterator toForEachIterator(boolean[] a) { > Boolean[] wrapped = new Boolean[a.length]; > for (int i = 0; i < a.length; i++) { >@@ -416,83 +434,103 @@ > } > > // returns an iterator over a byte[] array, wrapping items in Byte >+ > protected ForEachIterator toForEachIterator(byte[] a) { > Byte[] wrapped = new Byte[a.length]; >- for (int i = 0; i < a.length; i++) >+ for (int i = 0; i < a.length; i++) { > wrapped[i] = new Byte(a[i]); >+ } > return new SimpleForEachIterator(Arrays.asList(wrapped).iterator()); > } > > // returns an iterator over a char[] array, wrapping items in Character >+ > protected ForEachIterator toForEachIterator(char[] a) { > Character[] wrapped = new Character[a.length]; >- for (int i = 0; i < a.length; i++) >+ for (int i = 0; i < a.length; i++) { > wrapped[i] = new Character(a[i]); >+ } > return new SimpleForEachIterator(Arrays.asList(wrapped).iterator()); > } > > // returns an iterator over a short[] array, wrapping items in Short >+ > protected ForEachIterator toForEachIterator(short[] a) { > Short[] wrapped = new Short[a.length]; >- for (int i = 0; i < a.length; i++) >+ for (int i = 0; i < a.length; i++) { > wrapped[i] = new Short(a[i]); >+ } > return new SimpleForEachIterator(Arrays.asList(wrapped).iterator()); > } > > // returns an iterator over an int[] array, wrapping items in Integer >+ > protected ForEachIterator toForEachIterator(int[] a) { > Integer[] wrapped = new Integer[a.length]; >- for (int i = 0; i < a.length; i++) >+ for (int i = 0; i < a.length; i++) { > wrapped[i] = new Integer(a[i]); >+ } > return new SimpleForEachIterator(Arrays.asList(wrapped).iterator()); > } > > // returns an iterator over a long[] array, wrapping items in Long >+ > protected ForEachIterator toForEachIterator(long[] a) { > Long[] wrapped = new Long[a.length]; >- for (int i = 0; i < a.length; i++) >+ for (int i = 0; i < a.length; i++) { > wrapped[i] = new Long(a[i]); >+ } > return new SimpleForEachIterator(Arrays.asList(wrapped).iterator()); > } > > // returns an iterator over a float[] array, wrapping items in Float >+ > protected ForEachIterator toForEachIterator(float[] a) { > Float[] wrapped = new Float[a.length]; >- for (int i = 0; i < a.length; i++) >+ for (int i = 0; i < a.length; i++) { > wrapped[i] = new Float(a[i]); >+ } > return new SimpleForEachIterator(Arrays.asList(wrapped).iterator()); > } > > // returns an iterator over a double[] array, wrapping items in Double >+ > protected ForEachIterator toForEachIterator(double[] a) { > Double[] wrapped = new Double[a.length]; >- for (int i = 0; i < a.length; i++) >+ for (int i = 0; i < a.length; i++) { > wrapped[i] = new Double(a[i]); >+ } > return new SimpleForEachIterator(Arrays.asList(wrapped).iterator()); > } > > // retrieves an iterator from a Collection >+ > protected ForEachIterator toForEachIterator(Collection c) { > return new SimpleForEachIterator(c.iterator()); > } > > // simply passes an Iterator through... >+ > protected ForEachIterator toForEachIterator(Iterator i) { > return new SimpleForEachIterator(i); > } > > // converts an Enumeration to an Iterator via a local adapter >+ > protected ForEachIterator toForEachIterator(Enumeration e) { > > // local adapter > class EnumerationAdapter implements ForEachIterator { > private Enumeration e; >+ > public EnumerationAdapter(Enumeration e) { > this.e = e; > } >+ > public boolean hasNext() { > return e.hasMoreElements(); > } >+ > public Object next() { > return e.nextElement(); > } >@@ -502,6 +540,7 @@ > } > > // retrieves an iterator over the Map.Entry items in a Map >+ > protected ForEachIterator toForEachIterator(Map m) { > return new SimpleForEachIterator(m.entrySet().iterator()); > } >@@ -539,6 +578,7 @@ > */ > > // tokenizes a String as a CSV and returns an iterator over it >+ > protected ForEachIterator toForEachIterator(String s) { > StringTokenizer st = new StringTokenizer(s, ","); > return toForEachIterator(st); // convert from Enumeration >Index: src/main/java/org/apache/taglibs/standard/tag/common/core/OtherwiseTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/core/OtherwiseTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/core/OtherwiseTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.core; > >@@ -32,6 +32,7 @@ > */ > > // Don't let the condition stop us... :-) >+ > @Override > protected boolean condition() { > return true; >Index: src/main/java/org/apache/taglibs/standard/tag/common/core/ImportSupport.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/core/ImportSupport.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/core/ImportSupport.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.core; > >@@ -56,60 +56,63 @@ > * @author Shawn Bayern > */ > >-public abstract class ImportSupport extends BodyTagSupport >+public abstract class ImportSupport extends BodyTagSupport > implements TryCatchFinally, ParamParent { > > //********************************************************************* > // Public constants >- >- /** <p>Valid characters in a scheme.</p> >- * <p>RFC 1738 says the following:</p> >- * <blockquote> >- * Scheme names consist of a sequence of characters. The lower >- * case letters "a"--"z", digits, and the characters plus ("+"), >- * period ("."), and hyphen ("-") are allowed. For resiliency, >- * programs interpreting URLs should treat upper case letters as >- * equivalent to lower case in scheme names (e.g., allow "HTTP" as >- * well as "http"). >- * </blockquote> >+ >+ /** >+ * <p>Valid characters in a scheme.</p> >+ * <p>RFC 1738 says the following:</p> >+ * <blockquote> >+ * Scheme names consist of a sequence of characters. The lower >+ * case letters "a"--"z", digits, and the characters plus ("+"), >+ * period ("."), and hyphen ("-") are allowed. For resiliency, >+ * programs interpreting URLs should treat upper case letters as >+ * equivalent to lower case in scheme names (e.g., allow "HTTP" as >+ * well as "http"). >+ * </blockquote> > * <p>We treat as absolute any URL that begins with such a scheme name, > * followed by a colon.</p> > */ > public static final String VALID_SCHEME_CHARS = >- "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+.-"; >+ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+.-"; > >- /** Default character encoding for response. */ >+ /** >+ * Default character encoding for response. >+ */ > public static final String DEFAULT_ENCODING = "ISO-8859-1"; > > //********************************************************************* > // Protected state > > protected String url; // 'url' attribute >- protected String context; // 'context' attribute >+ protected String context; // 'context' attribute > protected String charEncoding; // 'charEncoding' attrib. > > //********************************************************************* > // Private state (implementation details) > > private String var; // 'var' attribute >- private int scope; // processed 'scope' attribute >+ private int scope; // processed 'scope' attribute > private String varReader; // 'varReader' attribute >- private Reader r; // exposed reader, if relevant >- private boolean isAbsoluteUrl; // is our URL absolute? >+ private Reader r; // exposed reader, if relevant >+ private boolean isAbsoluteUrl; // is our URL absolute? > private ParamSupport.ParamManager params; // parameters >- private String urlWithParams; // URL with parameters, if applicable >+ private String urlWithParams; // URL with parameters, if applicable > > //********************************************************************* > // Constructor and initialization > > public ImportSupport() { >- super(); >- init(); >+ super(); >+ init(); > } > > private void init() { >- url = var = varReader = context = charEncoding = urlWithParams = null; >- params = null; >+ url = var = varReader = context = charEncoding = urlWithParams = null; >+ params = null; > scope = PageContext.PAGE_SCOPE; > } > >@@ -118,82 +121,91 @@ > // Tag logic > > // determines what kind of import and variable exposure to perform >+ > @Override > public int doStartTag() throws JspException { >- // Sanity check >- if (context != null >- && (!context.startsWith("/") || !url.startsWith("/"))) { >- throw new JspTagException( >- Resources.getMessage("IMPORT_BAD_RELATIVE")); >- } >+ // Sanity check >+ if (context != null >+ && (!context.startsWith("/") || !url.startsWith("/"))) { >+ throw new JspTagException( >+ Resources.getMessage("IMPORT_BAD_RELATIVE")); >+ } > >- // reset parameter-related state >- urlWithParams = null; >- params = new ParamSupport.ParamManager(); >+ // reset parameter-related state >+ urlWithParams = null; >+ params = new ParamSupport.ParamManager(); > >- // check the URL >- if (url == null || url.equals("")) >- throw new NullAttributeException("import", "url"); >+ // check the URL >+ if (url == null || url.equals("")) { >+ throw new NullAttributeException("import", "url"); >+ } > >- // Record whether our URL is absolute or relative >- isAbsoluteUrl = isAbsoluteUrl(); >+ // Record whether our URL is absolute or relative >+ isAbsoluteUrl = isAbsoluteUrl(); > >- try { >- // If we need to expose a Reader, we've got to do it right away >- if (varReader != null) { >- r = acquireReader(); >- pageContext.setAttribute(varReader, r); >- } >- } catch (IOException ex) { >- throw new JspTagException(ex.toString(), ex); >- } >+ try { >+ // If we need to expose a Reader, we've got to do it right away >+ if (varReader != null) { >+ r = acquireReader(); >+ pageContext.setAttribute(varReader, r); >+ } >+ } catch (IOException ex) { >+ throw new JspTagException(ex.toString(), ex); >+ } > >- return EVAL_BODY_INCLUDE; >+ return EVAL_BODY_INCLUDE; > } > > // manages connections as necessary (creating or destroying) >+ > @Override > public int doEndTag() throws JspException { > try { >- // If we didn't expose a Reader earlier... >- if (varReader == null) { >- // ... store it in 'var', if available ... >- if (var != null) >- pageContext.setAttribute(var, acquireString(), scope); >+ // If we didn't expose a Reader earlier... >+ if (varReader == null) { >+ // ... store it in 'var', if available ... >+ if (var != null) { >+ pageContext.setAttribute(var, acquireString(), scope); >+ } > // ... or simply output it, if we have nowhere to expose it >- else >- pageContext.getOut().print(acquireString()); >- } >- return EVAL_PAGE; >+ else { >+ pageContext.getOut().print(acquireString()); >+ } >+ } >+ return EVAL_PAGE; > } catch (IOException ex) { >- throw new JspTagException(ex.toString(), ex); >+ throw new JspTagException(ex.toString(), ex); > } > } > > // simply rethrows its exception >+ > public void doCatch(Throwable t) throws Throwable { >- throw t; >+ throw t; > } > > // cleans up if appropriate >- public void doFinally() { >+ >+ public void doFinally() { > try { >- // If we exposed a Reader in doStartTag(), close it. >- if (varReader != null) { >- // 'r' can be null if an exception was thrown... >- if (r != null) >- r.close(); >- pageContext.removeAttribute(varReader, PageContext.PAGE_SCOPE); >- } >+ // If we exposed a Reader in doStartTag(), close it. >+ if (varReader != null) { >+ // 'r' can be null if an exception was thrown... >+ if (r != null) { >+ r.close(); >+ } >+ pageContext.removeAttribute(varReader, PageContext.PAGE_SCOPE); >+ } > } catch (IOException ex) { >- // ignore it; close() failed, but there's nothing more we can do >+ // ignore it; close() failed, but there's nothing more we can do > } > } > > // Releases any resources we may have (or inherit) >+ > @Override > public void release() { >- init(); >+ init(); > super.release(); > } > >@@ -201,15 +213,15 @@ > // Tag attributes known at translation time > > public void setVar(String var) { >- this.var = var; >+ this.var = var; > } > > public void setVarReader(String varReader) { >- this.varReader = varReader; >+ this.varReader = varReader; > } > > public void setScope(String scope) { >- this.scope = Util.getScope(scope); >+ this.scope = Util.getScope(scope); > } > > >@@ -217,8 +229,9 @@ > // Collaboration with subtags > > // inherit Javadoc >+ > public void addParameter(String name, String value) { >- params.addParameter(name, value); >+ params.addParameter(name, value); > } > > //********************************************************************* >@@ -241,118 +254,124 @@ > */ > > private String acquireString() throws IOException, JspException { >- if (isAbsoluteUrl) { >- // for absolute URLs, delegate to our peer >- BufferedReader r = new BufferedReader(acquireReader()); >- StringBuffer sb = new StringBuffer(); >- int i; >+ if (isAbsoluteUrl) { >+ // for absolute URLs, delegate to our peer >+ BufferedReader r = new BufferedReader(acquireReader()); >+ StringBuffer sb = new StringBuffer(); >+ int i; > >- // under JIT, testing seems to show this simple loop is as fast >- // as any of the alternatives >- while ((i = r.read()) != -1) >- sb.append((char)i); >+ // under JIT, testing seems to show this simple loop is as fast >+ // as any of the alternatives >+ while ((i = r.read()) != -1) { >+ sb.append((char) i); >+ } > >- return sb.toString(); >- } else { >- // handle relative URLs ourselves >+ return sb.toString(); >+ } else { >+ // handle relative URLs ourselves > >- // URL is relative, so we must be an HTTP request >- if (!(pageContext.getRequest() instanceof HttpServletRequest >- && pageContext.getResponse() instanceof HttpServletResponse)) >- throw new JspTagException( >- Resources.getMessage("IMPORT_REL_WITHOUT_HTTP")); >+ // URL is relative, so we must be an HTTP request >+ if (!(pageContext.getRequest() instanceof HttpServletRequest >+ && pageContext.getResponse() instanceof HttpServletResponse)) { >+ throw new JspTagException( >+ Resources.getMessage("IMPORT_REL_WITHOUT_HTTP")); >+ } > >- // retrieve an appropriate ServletContext >- ServletContext c = null; >- String targetUrl = targetUrl(); >- if (context != null) >- c = pageContext.getServletContext().getContext(context); >- else { >- c = pageContext.getServletContext(); >+ // retrieve an appropriate ServletContext >+ ServletContext c = null; >+ String targetUrl = targetUrl(); >+ if (context != null) { >+ c = pageContext.getServletContext().getContext(context); >+ } else { >+ c = pageContext.getServletContext(); > >- // normalize the URL if we have an HttpServletRequest >- if (!targetUrl.startsWith("/")) { >- String sp = ((HttpServletRequest) >- pageContext.getRequest()).getServletPath(); >- targetUrl = sp.substring(0, sp.lastIndexOf('/')) >- + '/' + targetUrl; >- } >- } >+ // normalize the URL if we have an HttpServletRequest >+ if (!targetUrl.startsWith("/")) { >+ String sp = ((HttpServletRequest) >+ pageContext.getRequest()).getServletPath(); >+ targetUrl = sp.substring(0, sp.lastIndexOf('/')) >+ + '/' + targetUrl; >+ } >+ } > > if (c == null) { > throw new JspTagException( >- Resources.getMessage( >- "IMPORT_REL_WITHOUT_DISPATCHER", context, targetUrl)); >+ Resources.getMessage( >+ "IMPORT_REL_WITHOUT_DISPATCHER", context, targetUrl)); > } > >- // from this context, get a dispatcher >- RequestDispatcher rd = >- c.getRequestDispatcher(stripSession(targetUrl)); >- if (rd == null) >- throw new JspTagException(stripSession(targetUrl)); >+ // from this context, get a dispatcher >+ RequestDispatcher rd = >+ c.getRequestDispatcher(stripSession(targetUrl)); >+ if (rd == null) { >+ throw new JspTagException(stripSession(targetUrl)); >+ } > >- // include the resource, using our custom wrapper >- ImportResponseWrapper irw = >- new ImportResponseWrapper( >- (HttpServletResponse) pageContext.getResponse()); >+ // include the resource, using our custom wrapper >+ ImportResponseWrapper irw = >+ new ImportResponseWrapper( >+ (HttpServletResponse) pageContext.getResponse()); > >- ImportRequestWrapper wrappedRequest = >- new ImportRequestWrapper( >- (HttpServletRequest) pageContext.getRequest()); >+ ImportRequestWrapper wrappedRequest = >+ new ImportRequestWrapper( >+ (HttpServletRequest) pageContext.getRequest()); > >- // spec mandates specific error handling form include() >- try { >- rd.include(wrappedRequest, irw); >- } catch (IOException ex) { >- throw new JspException(ex); >- } catch (RuntimeException ex) { >- throw new JspException(ex); >- } catch (ServletException ex) { >- Throwable rc = ex.getRootCause(); >- while (rc instanceof ServletException) { >- rc = ((ServletException) rc).getRootCause(); >- } >- if (rc == null) >- throw new JspException(ex); >- else >- throw new JspException(rc); >- } >+ // spec mandates specific error handling form include() >+ try { >+ rd.include(wrappedRequest, irw); >+ } catch (IOException ex) { >+ throw new JspException(ex); >+ } catch (RuntimeException ex) { >+ throw new JspException(ex); >+ } catch (ServletException ex) { >+ Throwable rc = ex.getRootCause(); >+ while (rc instanceof ServletException) { >+ rc = ((ServletException) rc).getRootCause(); >+ } >+ if (rc == null) { >+ throw new JspException(ex); >+ } else { >+ throw new JspException(rc); >+ } >+ } > >- // disallow inappropriate response codes per JSTL spec >- if (irw.getStatus() < 200 || irw.getStatus() > 299) { >- throw new JspTagException(irw.getStatus() + " " + >- stripSession(targetUrl)); >- } >+ // disallow inappropriate response codes per JSTL spec >+ if (irw.getStatus() < 200 || irw.getStatus() > 299) { >+ throw new JspTagException(irw.getStatus() + " " + >+ stripSession(targetUrl)); >+ } > >- // recover the response String from our wrapper >- return irw.getString(); >- } >+ // recover the response String from our wrapper >+ return irw.getString(); >+ } > } > > private Reader acquireReader() throws IOException, JspException { >- if (!isAbsoluteUrl) { >- // for relative URLs, delegate to our peer >- return new StringReader(acquireString()); >- } else { >+ if (!isAbsoluteUrl) { >+ // for relative URLs, delegate to our peer >+ return new StringReader(acquireString()); >+ } else { > // absolute URL > String target = targetUrl(); >- try { >- // handle absolute URLs ourselves, using java.net.URL >- URL u = new URL(target); >+ try { >+ // handle absolute URLs ourselves, using java.net.URL >+ URL u = new URL(target); > URLConnection uc = u.openConnection(); > InputStream i = uc.getInputStream(); > >- // okay, we've got a stream; encode it appropriately >- Reader r = null; >- String charSet; >- if (charEncoding != null && !charEncoding.equals("")) { >+ // okay, we've got a stream; encode it appropriately >+ Reader r = null; >+ String charSet; >+ if (charEncoding != null && !charEncoding.equals("")) { > charSet = charEncoding; > } else { > // charSet extracted according to RFC 2045, section 5.1 >- String contentType = uc.getContentType(); >- if (contentType != null) { >+ String contentType = uc.getContentType(); >+ if (contentType != null) { > charSet = Util.getContentTypeAttribute(contentType, "charset"); >- if (charSet == null) charSet = DEFAULT_ENCODING; >+ if (charSet == null) { >+ charSet = DEFAULT_ENCODING; >+ } > } else { > charSet = DEFAULT_ENCODING; > } >@@ -363,32 +382,35 @@ > r = new InputStreamReader(i, DEFAULT_ENCODING); > } > >- // check response code for HTTP URLs before returning, per spec, >- // before returning >- if (uc instanceof HttpURLConnection) { >- int status = ((HttpURLConnection) uc).getResponseCode(); >- if (status < 200 || status > 299) >- throw new JspTagException(status + " " + target); >- } >+ // check response code for HTTP URLs before returning, per spec, >+ // before returning >+ if (uc instanceof HttpURLConnection) { >+ int status = ((HttpURLConnection) uc).getResponseCode(); >+ if (status < 200 || status > 299) { >+ throw new JspTagException(status + " " + target); >+ } >+ } > >- return r; >- } catch (IOException ex) { >- throw new JspException( >- Resources.getMessage("IMPORT_ABS_ERROR", target, ex), ex); >- } catch (RuntimeException ex) { // because the spec makes us >- throw new JspException( >- Resources.getMessage("IMPORT_ABS_ERROR", target, ex), ex); >- } >- } >+ return r; >+ } catch (IOException ex) { >+ throw new JspException( >+ Resources.getMessage("IMPORT_ABS_ERROR", target, ex), ex); >+ } catch (RuntimeException ex) { // because the spec makes us >+ throw new JspException( >+ Resources.getMessage("IMPORT_ABS_ERROR", target, ex), ex); >+ } >+ } > } > >- /** Wraps requests to allow us to enforce the method to be GET */ >+ /** >+ * Wraps requests to allow us to enforce the method to be GET >+ */ > private class ImportRequestWrapper extends HttpServletRequestWrapper { > > public ImportRequestWrapper(HttpServletRequest request) { > super(request); > } >- >+ > @Override > public String getMethod() { > return "GET"; >@@ -396,134 +418,165 @@ > > } > >- /** Wraps responses to allow us to retrieve results as Strings. */ >+ /** >+ * Wraps responses to allow us to retrieve results as Strings. >+ */ > private class ImportResponseWrapper extends HttpServletResponseWrapper { > >- //************************************************************ >- // Overview >+ //************************************************************ >+ // Overview > >- /* >- * We provide either a Writer or an OutputStream as requested. >- * We actually have a true Writer and an OutputStream backing >- * both, since we don't want to use a character encoding both >- * ways (Writer -> OutputStream -> Writer). So we use no >- * encoding at all (as none is relevant) when the target resource >- * uses a Writer. And we decode the OutputStream's bytes >- * using OUR tag's 'charEncoding' attribute, or ISO-8859-1 >- * as the default. We thus ignore setLocale() and setContentType() >- * in this wrapper. >- * >- * In other words, the target's asserted encoding is used >- * to convert from a Writer to an OutputStream, which is typically >- * the medium through with the target will communicate its >- * ultimate response. Since we short-circuit that mechanism >- * and read the target's characters directly if they're offered >- * as such, we simply ignore the target's encoding assertion. >- */ >+ /* >+ * We provide either a Writer or an OutputStream as requested. >+ * We actually have a true Writer and an OutputStream backing >+ * both, since we don't want to use a character encoding both >+ * ways (Writer -> OutputStream -> Writer). So we use no >+ * encoding at all (as none is relevant) when the target resource >+ * uses a Writer. And we decode the OutputStream's bytes >+ * using OUR tag's 'charEncoding' attribute, or ISO-8859-1 >+ * as the default. We thus ignore setLocale() and setContentType() >+ * in this wrapper. >+ * >+ * In other words, the target's asserted encoding is used >+ * to convert from a Writer to an OutputStream, which is typically >+ * the medium through with the target will communicate its >+ * ultimate response. Since we short-circuit that mechanism >+ * and read the target's characters directly if they're offered >+ * as such, we simply ignore the target's encoding assertion. >+ */ > >- //************************************************************ >- // Data >+ //************************************************************ >+ // Data > >- /** The Writer we convey. */ >- private StringWriter sw = new StringWriter(); >+ /** >+ * The Writer we convey. >+ */ >+ private StringWriter sw = new StringWriter(); > >- /** A buffer, alternatively, to accumulate bytes. */ >- private ByteArrayOutputStream bos = new ByteArrayOutputStream(); >+ /** >+ * A buffer, alternatively, to accumulate bytes. >+ */ >+ private ByteArrayOutputStream bos = new ByteArrayOutputStream(); > >- /** A ServletOutputStream we convey, tied to this Writer. */ >- private ServletOutputStream sos = new ServletOutputStream() { >- @Override >- public void write(int b) throws IOException { >- bos.write(b); >- } >- }; >+ /** >+ * A ServletOutputStream we convey, tied to this Writer. >+ */ >+ private ServletOutputStream sos = new ServletOutputStream() { >+ @Override >+ public void write(int b) throws IOException { >+ bos.write(b); >+ } >+ }; > >- /** 'True' if getWriter() was called; false otherwise. */ >- private boolean isWriterUsed; >+ /** >+ * 'True' if getWriter() was called; false otherwise. >+ */ >+ private boolean isWriterUsed; > >- /** 'True if getOutputStream() was called; false otherwise. */ >- private boolean isStreamUsed; >+ /** >+ * 'True if getOutputStream() was called; false otherwise. >+ */ >+ private boolean isStreamUsed; > >- /** The HTTP status set by the target. */ >- private int status = 200; >- >- //************************************************************ >- // Constructor and methods >+ /** >+ * The HTTP status set by the target. >+ */ >+ private int status = 200; > >- /** Constructs a new ImportResponseWrapper. */ >- public ImportResponseWrapper(HttpServletResponse response) { >- super(response); >- } >- >- /** Returns a Writer designed to buffer the output. */ >- @Override >- public PrintWriter getWriter() { >- if (isStreamUsed) >- throw new IllegalStateException( >- Resources.getMessage("IMPORT_ILLEGAL_STREAM")); >- isWriterUsed = true; >- return new PrintWriter(sw); >- } >- >- /** Returns a ServletOutputStream designed to buffer the output. */ >- @Override >- public ServletOutputStream getOutputStream() { >- if (isWriterUsed) >- throw new IllegalStateException( >- Resources.getMessage("IMPORT_ILLEGAL_WRITER")); >- isStreamUsed = true; >- return sos; >- } >+ //************************************************************ >+ // Constructor and methods > >- /** Has no effect. */ >- @Override >- public void setContentType(String x) { >- // ignore >- } >+ /** >+ * Constructs a new ImportResponseWrapper. >+ */ >+ public ImportResponseWrapper(HttpServletResponse response) { >+ super(response); >+ } > >- /** Has no effect. */ >- @Override >- public void setLocale(Locale x) { >- // ignore >- } >+ /** >+ * Returns a Writer designed to buffer the output. >+ */ >+ @Override >+ public PrintWriter getWriter() { >+ if (isStreamUsed) { >+ throw new IllegalStateException( >+ Resources.getMessage("IMPORT_ILLEGAL_STREAM")); >+ } >+ isWriterUsed = true; >+ return new PrintWriter(sw); >+ } > >- @Override >- public void setStatus(int status) { >- this.status = status; >- } >+ /** >+ * Returns a ServletOutputStream designed to buffer the output. >+ */ >+ @Override >+ public ServletOutputStream getOutputStream() { >+ if (isWriterUsed) { >+ throw new IllegalStateException( >+ Resources.getMessage("IMPORT_ILLEGAL_WRITER")); >+ } >+ isStreamUsed = true; >+ return sos; >+ } > >- public int getStatus() { >- return status; >- } >+ /** >+ * Has no effect. >+ */ >+ @Override >+ public void setContentType(String x) { >+ // ignore >+ } > >- /** >- * Retrieves the buffered output, using the containing tag's >- * 'charEncoding' attribute, or the tag's default encoding, >- * <b>if necessary</b>. >+ /** >+ * Has no effect. > */ >- // not simply toString() because we need to throw >- // UnsupportedEncodingException >- public String getString() throws UnsupportedEncodingException { >- if (isWriterUsed) >- return sw.toString(); >- else if (isStreamUsed) { >- if (charEncoding != null && !charEncoding.equals("")) >- return bos.toString(charEncoding); >- else >- return bos.toString(DEFAULT_ENCODING); >- } else >- return ""; // target didn't write anything >- } >+ @Override >+ public void setLocale(Locale x) { >+ // ignore >+ } >+ >+ @Override >+ public void setStatus(int status) { >+ this.status = status; >+ } >+ >+ public int getStatus() { >+ return status; >+ } >+ >+ /** >+ * Retrieves the buffered output, using the containing tag's >+ * 'charEncoding' attribute, or the tag's default encoding, >+ * <b>if necessary</b>. >+ */ >+ // not simply toString() because we need to throw >+ // UnsupportedEncodingException >+ public String getString() throws UnsupportedEncodingException { >+ if (isWriterUsed) { >+ return sw.toString(); >+ } else if (isStreamUsed) { >+ if (charEncoding != null && !charEncoding.equals("")) { >+ return bos.toString(charEncoding); >+ } else { >+ return bos.toString(DEFAULT_ENCODING); >+ } >+ } else { >+ return ""; >+ } // target didn't write anything >+ } > } > > //********************************************************************* > // Some private utility methods > >- /** Returns our URL (potentially with parameters) */ >+ /** >+ * Returns our URL (potentially with parameters) >+ */ > private String targetUrl() { >- if (urlWithParams == null) >- urlWithParams = params.aggregateParams(url); >- return urlWithParams; >+ if (urlWithParams == null) { >+ urlWithParams = params.aggregateParams(url); >+ } >+ return urlWithParams; > } > > /** >@@ -543,23 +596,27 @@ > * <tt>false</tt> otherwise. > */ > public static boolean isAbsoluteUrl(String url) { >- // a null URL is not absolute, by our definition >- if (url == null) >- return false; >+ // a null URL is not absolute, by our definition >+ if (url == null) { >+ return false; >+ } > >- // do a fast, simple check first >- int colonPos; >- if ((colonPos = url.indexOf(":")) == -1) >- return false; >+ // do a fast, simple check first >+ int colonPos; >+ if ((colonPos = url.indexOf(":")) == -1) { >+ return false; >+ } > >- // if we DO have a colon, make sure that every character >- // leading up to it is a valid scheme character >- for (int i = 0; i < colonPos; i++) >- if (VALID_SCHEME_CHARS.indexOf(url.charAt(i)) == -1) >- return false; >+ // if we DO have a colon, make sure that every character >+ // leading up to it is a valid scheme character >+ for (int i = 0; i < colonPos; i++) { >+ if (VALID_SCHEME_CHARS.indexOf(url.charAt(i)) == -1) { >+ return false; >+ } >+ } > >- // if so, we've got an absolute url >- return true; >+ // if so, we've got an absolute url >+ return true; > } > > /** >@@ -569,14 +626,17 @@ > * and either EOS or a subsequent ';' (exclusive). > */ > public static String stripSession(String url) { >- StringBuffer u = new StringBuffer(url); >+ StringBuffer u = new StringBuffer(url); > int sessionStart; > while ((sessionStart = u.toString().indexOf(";jsessionid=")) != -1) { > int sessionEnd = u.toString().indexOf(";", sessionStart + 1); >- if (sessionEnd == -1) >- sessionEnd = u.toString().indexOf("?", sessionStart + 1); >- if (sessionEnd == -1) // still >+ if (sessionEnd == -1) { >+ sessionEnd = u.toString().indexOf("?", sessionStart + 1); >+ } >+ if (sessionEnd == -1) // still >+ { > sessionEnd = u.length(); >+ } > u.delete(sessionStart, sessionEnd); > } > return u.toString(); >Index: src/main/java/org/apache/taglibs/standard/tag/common/core/ForTokensSupport.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/core/ForTokensSupport.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/core/ForTokensSupport.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.core; > >@@ -33,8 +33,8 @@ > * expression-evaluating libraries each have handlers that extend this > * class.</p> > * >+ * @author Shawn Bayern > * @see javax.servlet.jsp.jstl.core.LoopTagSupport >- * @author Shawn Bayern > */ > > public abstract class ForTokensSupport extends LoopTagSupport { >@@ -76,12 +76,12 @@ > ELContext myELContext = pageContext.getELContext(); > Object originalValue = deferredExpression.getValue(myELContext); > if (originalValue instanceof String) { >- st = new StringTokenizer((String)originalValue, delims); >+ st = new StringTokenizer((String) originalValue, delims); > } else { > throw new JspTagException(); > } > } else { >- st = new StringTokenizer((String)items, delims); >+ st = new StringTokenizer((String) items, delims); > } > } > >@@ -92,9 +92,9 @@ > > @Override > protected Object next() throws JspTagException { >- if (deferredExpression!=null) { >+ if (deferredExpression != null) { > st.nextElement(); >- if (itemsValueIteratedExpression==null) { >+ if (itemsValueIteratedExpression == null) { > itemsValueIteratedExpression = new IteratedExpression(deferredExpression, getDelims()); > } > ValueExpression nextValue = new IteratedValueExpression(itemsValueIteratedExpression, currentIndex); >@@ -111,6 +111,7 @@ > > > // Releases any resources we may have (or inherit) >+ > @Override > public void release() { > super.release(); >Index: src/main/java/org/apache/taglibs/standard/tag/common/core/ParamParent.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/core/ParamParent.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/core/ParamParent.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.core; > >Index: src/main/java/org/apache/taglibs/standard/tag/common/core/ChooseTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/core/ChooseTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/core/ChooseTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.core; > >@@ -24,7 +24,7 @@ > > /** > * <p>Tag handler for <choose> in JSTL.</p> >- * >+ * <p/> > * <p><choose> is a very simple tag that acts primarily as a container; > * it always includes its body and allows exactly one of its child > * <when> tags to run. Since this tag handler doesn't have any >@@ -40,12 +40,14 @@ > // Constructor and lifecycle management > > // initialize inherited and local state >+ > public ChooseTag() { > super(); > init(); > } > > // Releases any resources we may have (or inherit) >+ > @Override > public void release() { > super.release(); >@@ -77,9 +79,10 @@ > * body. > */ > public synchronized void subtagSucceeded() { >- if (subtagGateClosed) >+ if (subtagGateClosed) { > throw new IllegalStateException( >- Resources.getMessage("CHOOSE_EXCLUSIVITY")); >+ Resources.getMessage("CHOOSE_EXCLUSIVITY")); >+ } > subtagGateClosed = true; > } > >@@ -88,9 +91,10 @@ > // Tag logic > > // always include body >+ > @Override > public int doStartTag() throws JspException { >- subtagGateClosed = false; // when we start, no children have run >+ subtagGateClosed = false; // when we start, no children have run > return EVAL_BODY_INCLUDE; > } > >Index: src/main/java/org/apache/taglibs/standard/tag/common/core/NullAttributeException.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/core/NullAttributeException.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/core/NullAttributeException.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.core; > >@@ -38,6 +38,6 @@ > * @param att The attribute value for which the error occurred. > */ > public NullAttributeException(String tag, String att) { >- super(Resources.getMessage("TAG_NULL_ATTRIBUTE", att, tag)); >+ super(Resources.getMessage("TAG_NULL_ATTRIBUTE", att, tag)); > } > } >Index: src/main/java/org/apache/taglibs/standard/tag/common/core/Util.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/core/Util.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/core/Util.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.core; > >@@ -34,9 +34,9 @@ > */ > public class Util { > >- private static final String REQUEST = "request"; >- private static final String SESSION = "session"; >- private static final String APPLICATION = "application"; >+ private static final String REQUEST = "request"; >+ private static final String SESSION = "session"; >+ private static final String APPLICATION = "application"; > private static final String DEFAULT = "default"; > private static final String SHORT = "short"; > private static final String MEDIUM = "medium"; >@@ -54,17 +54,19 @@ > * > * @return PageContext constant corresponding to given scope description > */ >+ > public static int getScope(String scope) { >- int ret = PageContext.PAGE_SCOPE; // default >+ int ret = PageContext.PAGE_SCOPE; // default > >- if (REQUEST.equalsIgnoreCase(scope)) >- ret = PageContext.REQUEST_SCOPE; >- else if (SESSION.equalsIgnoreCase(scope)) >- ret = PageContext.SESSION_SCOPE; >- else if (APPLICATION.equalsIgnoreCase(scope)) >- ret = PageContext.APPLICATION_SCOPE; >+ if (REQUEST.equalsIgnoreCase(scope)) { >+ ret = PageContext.REQUEST_SCOPE; >+ } else if (SESSION.equalsIgnoreCase(scope)) { >+ ret = PageContext.SESSION_SCOPE; >+ } else if (APPLICATION.equalsIgnoreCase(scope)) { >+ ret = PageContext.APPLICATION_SCOPE; >+ } > >- return ret; >+ return ret; > } > > /* >@@ -78,27 +80,28 @@ > * > * @throws JspException if the given style is invalid > */ >+ > public static int getStyle(String style, String errCode) >- throws JspException { >- int ret = DateFormat.DEFAULT; >+ throws JspException { >+ int ret = DateFormat.DEFAULT; > >- if (style != null) { >- if (DEFAULT.equalsIgnoreCase(style)) { >- ret = DateFormat.DEFAULT; >- } else if (SHORT.equalsIgnoreCase(style)) { >- ret = DateFormat.SHORT; >- } else if (MEDIUM.equalsIgnoreCase(style)) { >- ret = DateFormat.MEDIUM; >- } else if (LONG.equalsIgnoreCase(style)) { >- ret = DateFormat.LONG; >- } else if (FULL.equalsIgnoreCase(style)) { >- ret = DateFormat.FULL; >- } else { >- throw new JspException(Resources.getMessage(errCode, style)); >- } >- } >+ if (style != null) { >+ if (DEFAULT.equalsIgnoreCase(style)) { >+ ret = DateFormat.DEFAULT; >+ } else if (SHORT.equalsIgnoreCase(style)) { >+ ret = DateFormat.SHORT; >+ } else if (MEDIUM.equalsIgnoreCase(style)) { >+ ret = DateFormat.MEDIUM; >+ } else if (LONG.equalsIgnoreCase(style)) { >+ ret = DateFormat.LONG; >+ } else if (FULL.equalsIgnoreCase(style)) { >+ ret = DateFormat.FULL; >+ } else { >+ throw new JspException(Resources.getMessage(errCode, style)); >+ } >+ } > >- return ret; >+ return ret; > } > > >@@ -107,48 +110,57 @@ > * Syntax defined in RFC 2045, section 5.1. > */ > public static String getContentTypeAttribute(String input, String name) { >- int begin; >- int end; >+ int begin; >+ int end; > int index = input.toUpperCase().indexOf(name.toUpperCase()); >- if (index == -1) return null; >+ if (index == -1) { >+ return null; >+ } > index = index + name.length(); // positioned after the attribute name > index = input.indexOf('=', index); // positioned at the '=' >- if (index == -1) return null; >+ if (index == -1) { >+ return null; >+ } > index += 1; // positioned after the '=' > input = input.substring(index).trim(); >- >+ > if (input.charAt(0) == '"') { > // attribute value is a quoted string > begin = 1; > end = input.indexOf('"', begin); >- if (end == -1) return null; >+ if (end == -1) { >+ return null; >+ } > } else { > begin = 0; > end = input.indexOf(';'); >- if (end == -1) end = input.indexOf(' '); >- if (end == -1) end = input.length(); >+ if (end == -1) { >+ end = input.indexOf(' '); >+ } >+ if (end == -1) { >+ end = input.length(); >+ } > } > return input.substring(begin, end).trim(); > } > > /** >- * HttpServletRequest.getLocales() returns the server's default locale >+ * HttpServletRequest.getLocales() returns the server's default locale > * if the request did not specify a preferred language. > * We do not want this behavior, because it prevents us from using >- * the fallback locale. >- * We therefore need to return an empty Enumeration if no preferred >- * locale has been specified. This way, the logic for the fallback >+ * the fallback locale. >+ * We therefore need to return an empty Enumeration if no preferred >+ * locale has been specified. This way, the logic for the fallback > * locale will be able to kick in. > */ >- public static Enumeration getRequestLocales(HttpServletRequest request) { >+ public static Enumeration getRequestLocales(HttpServletRequest request) { > Enumeration values = request.getHeaders("accept-language"); > if (values == null) { > // No header for "accept-language". Simply return > // a new empty enumeration. > // System.out.println("Null accept-language"); > return new Vector().elements(); >- } else >- if (values.hasMoreElements()) { >+ } else if (values.hasMoreElements()) { > // At least one "accept-language". Simply return > // the enumeration returned by request.getLocales(). > // System.out.println("At least one accept-language"); >Index: src/main/java/org/apache/taglibs/standard/tag/common/core/CatchTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/core/CatchTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/core/CatchTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.core; > >@@ -23,7 +23,7 @@ > > /** > * <p>Tag handler for <catch> in JSTL 1.0.</p> >- * >+ * <p/> > * <p><catch> simply catches any Throwables that occur in its body > * and optionally exposes them. > * >@@ -41,12 +41,14 @@ > // Constructor and lifecycle management > > // initialize inherited and local state >+ > public CatchTag() { > super(); > init(); > } > > // Releases any resources we may have (or inherit) >+ > @Override > public void release() { > super.release(); >@@ -71,18 +73,20 @@ > @Override > public int doStartTag() { > caught = false; >- return EVAL_BODY_INCLUDE; >+ return EVAL_BODY_INCLUDE; > } > > public void doCatch(Throwable t) { >- if (var != null) >+ if (var != null) { > pageContext.setAttribute(var, t, PageContext.PAGE_SCOPE); >+ } > caught = true; > } > > public void doFinally() { >- if (var != null && !caught) >+ if (var != null && !caught) { > pageContext.removeAttribute(var, PageContext.PAGE_SCOPE); >+ } > } > > >Index: src/main/java/org/apache/taglibs/standard/tag/common/core/SetSupport.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/core/SetSupport.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/core/SetSupport.java (working copy) >@@ -13,31 +13,27 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.core; > > import java.beans.IntrospectionException; > import java.beans.Introspector; > import java.beans.PropertyDescriptor; >- > import java.lang.reflect.InvocationTargetException; > import java.lang.reflect.Method; >- > import java.util.Map; > >+import javax.el.ELContext; >+import javax.el.ELException; >+import javax.el.ExpressionFactory; >+import javax.el.ValueExpression; >+import javax.el.VariableMapper; > import javax.servlet.jsp.JspApplicationContext; > import javax.servlet.jsp.JspException; > import javax.servlet.jsp.JspFactory; > import javax.servlet.jsp.JspTagException; > import javax.servlet.jsp.PageContext; >- >-import javax.el.ELException; >-import javax.el.ELContext; >-import javax.el.ValueExpression; >-import javax.el.VariableMapper; >-import javax.el.ExpressionFactory; >- > import javax.servlet.jsp.tagext.BodyTagSupport; > > import org.apache.taglibs.standard.resources.Resources; >@@ -68,6 +64,7 @@ > } > > // Releases any resources we may have (or inherit) >+ > @Override > public void release() { > var = null; >@@ -172,7 +169,7 @@ > if (scopeValue != PageContext.PAGE_SCOPE) { > throw new JspTagException(Resources.getMessage("SET_BAD_DEFERRED_SCOPE", scope)); > } >- vm.setVariable(var, (ValueExpression)result); >+ vm.setVariable(var, (ValueExpression) result); > } else { > // make sure to remove it from the VariableMapper if we will be setting into page scope > if (scopeValue == PageContext.PAGE_SCOPE && vm.resolveVariable(var) != null) { >@@ -182,7 +179,7 @@ > } > } else { > //make sure to remove it from the Var mapper >- if (vm.resolveVariable(var)!=null) { >+ if (vm.resolveVariable(var) != null) { > vm.setVariable(var, null); > } > if (scope != null) { >@@ -196,9 +193,9 @@ > /** > * Export the result into a Map. > * >- * @param target the Map to export into >+ * @param target the Map to export into > * @param property the key to export into >- * @param result the value to export >+ * @param result the value to export > */ > void exportToMapProperty(Object target, String property, Object result) { > @SuppressWarnings("unchecked") >@@ -213,9 +210,9 @@ > /** > * Export the result into a bean property. > * >- * @param target the bean to export into >+ * @param target the bean to export into > * @param property the bean property to set >- * @param result the value to export >+ * @param result the value to export > * @throws JspTagException if there was a problem exporting the result > */ > void exportToBeanProperty(Object target, String property, Object result) throws JspTagException { >@@ -252,7 +249,7 @@ > * rules of the Expression Language. > * > * @param value the value to convert >- * @param m the setter method >+ * @param m the setter method > * @return value converted to an instance of the expected type; will be null if value was null > * @throws javax.el.ELException if there was a problem coercing the value > */ >Index: src/main/java/org/apache/taglibs/standard/tag/common/core/RemoveTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/core/RemoveTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/core/RemoveTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.core; > >@@ -32,9 +32,9 @@ > //********************************************************************* > // Internal state > >- private int scope; // tag attribute >- private boolean scopeSpecified; // ... by tag attribute >- private String var; // tag attribute >+ private int scope; // tag attribute >+ private boolean scopeSpecified; // ... by tag attribute >+ private String var; // tag attribute > > > //********************************************************************* >@@ -51,6 +51,7 @@ > } > > // resets local state >+ > private void init() { > var = null; > scope = PageContext.PAGE_SCOPE; >@@ -58,6 +59,7 @@ > } > > // Releases any resources we may have (or inherit) >+ > @Override > public void release() { > super.release(); >@@ -69,13 +71,15 @@ > // Tag logic > > // removes the variable (from a specific scope, if specified) >+ > @Override > public int doEndTag() throws JspException { >- if (!scopeSpecified) >+ if (!scopeSpecified) { > pageContext.removeAttribute(var); >- else >+ } else { > pageContext.removeAttribute(var, scope); >- return EVAL_PAGE; >+ } >+ return EVAL_PAGE; > } > > >@@ -83,13 +87,15 @@ > // Accessor methods > > // for tag attribute >+ > public void setVar(String var) { >- this.var = var; >+ this.var = var; > } > > // for tag attribute >+ > public void setScope(String scope) { > this.scope = Util.getScope(scope); >- scopeSpecified = true; >+ scopeSpecified = true; > } > } >Index: src/main/java/org/apache/taglibs/standard/tag/common/core/WhenTagSupport.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/core/WhenTagSupport.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/core/WhenTagSupport.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.core; > >@@ -29,18 +29,17 @@ > * implementation of <when>-style tags in both the rtexprvalue > * and expression-evaluating libraries. It also supports > * <otherwise>.</p> >- * >+ * <p/> > * <p>In particular, this base class does the following:</p> >- * >+ * <p/> > * <ul> >- * <li> overrides ConditionalTagSupport.doStartTag() to implement the >- * appropriate semantics of subtags of <choose> </li> >+ * <li> overrides ConditionalTagSupport.doStartTag() to implement the >+ * appropriate semantics of subtags of <choose> </li> > * </ul> > * > * @author Shawn Bayern > */ >-public abstract class WhenTagSupport extends ConditionalTagSupport >-{ >+public abstract class WhenTagSupport extends ConditionalTagSupport { > //********************************************************************* > // Implementation of exclusive-conditional behavior > >@@ -49,25 +48,29 @@ > * ChooseTag wants it to do so. The condition will not even be > * evaluated if ChooseTag instructs us not to run. > */ >+ > @Override > public int doStartTag() throws JspException { > > Tag parent; > > // make sure we're contained properly >- if (!((parent = getParent()) instanceof ChooseTag)) >+ if (!((parent = getParent()) instanceof ChooseTag)) { > throw new JspTagException( >- Resources.getMessage("WHEN_OUTSIDE_CHOOSE")); >+ Resources.getMessage("WHEN_OUTSIDE_CHOOSE")); >+ } > > // make sure our parent wants us to continue >- if (!((ChooseTag) parent).gainPermission()) >- return SKIP_BODY; // we've been reeled in >+ if (!((ChooseTag) parent).gainPermission()) { >+ return SKIP_BODY; >+ } // we've been reeled in > > // handle conditional behavior > if (condition()) { > ((ChooseTag) parent).subtagSucceeded(); > return EVAL_BODY_INCLUDE; >- } else >+ } else { > return SKIP_BODY; >+ } > } > } >Index: src/main/java/org/apache/taglibs/standard/tag/common/core/DeclareTag.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/core/DeclareTag.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/core/DeclareTag.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.core; > >@@ -24,7 +24,7 @@ > * essentially a runtime no-op as far as tag logic is concerned; the > * only important functionality of the tag is to expose a scripting > * variable for an existing scoped attribute.</p> >- * >+ * > * @author Shawn Bayern > */ > >@@ -34,5 +34,7 @@ > * We're not identical to TagSupport only because we need to > * accept an additional "type" attribute. > */ >- public void setType(String x) { } >+ >+ public void setType(String x) { >+ } > } >Index: src/main/java/org/apache/taglibs/standard/tag/common/core/ParamSupport.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/core/ParamSupport.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/core/ParamSupport.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.core; > >@@ -33,8 +33,8 @@ > * <p>Support for tag handlers for <param>, the URL parameter > * subtag for <import> in JSTL 1.0.</p> > * >+ * @author Shawn Bayern > * @see ParamParent, ImportSupport, URLEncodeSupport >- * @author Shawn Bayern > */ > > public abstract class ParamSupport extends BodyTagSupport { >@@ -56,38 +56,42 @@ > // Constructor and initialization > > public ParamSupport() { >- super(); >- init(); >+ super(); >+ init(); > } > > private void init() { >- name = value = null; >+ name = value = null; > } > > //********************************************************************* > // Tag logic > > // simply send our name and value to our appropriate ancestor >+ > @Override > public int doEndTag() throws JspException { >- Tag t = findAncestorWithClass(this, ParamParent.class); >- if (t == null) >- throw new JspTagException( >- Resources.getMessage("PARAM_OUTSIDE_PARENT")); >+ Tag t = findAncestorWithClass(this, ParamParent.class); >+ if (t == null) { >+ throw new JspTagException( >+ Resources.getMessage("PARAM_OUTSIDE_PARENT")); >+ } > >- // take no action for null or empty names >- if (name == null || name.equals("")) >- return EVAL_PAGE; >+ // take no action for null or empty names >+ if (name == null || name.equals("")) { >+ return EVAL_PAGE; >+ } > >- // send the parameter to the appropriate ancestor >- ParamParent parent = (ParamParent) t; >- String value = this.value; >- if (value == null) { >- if (bodyContent == null || bodyContent.getString() == null) >- value = ""; >- else >- value = bodyContent.getString().trim(); >- } >+ // send the parameter to the appropriate ancestor >+ ParamParent parent = (ParamParent) t; >+ String value = this.value; >+ if (value == null) { >+ if (bodyContent == null || bodyContent.getString() == null) { >+ value = ""; >+ } else { >+ value = bodyContent.getString().trim(); >+ } >+ } > if (encode) { > String enc = pageContext.getResponse().getCharacterEncoding(); > try { >@@ -98,87 +102,94 @@ > } else { > parent.addParameter(name, value); > } >- return EVAL_PAGE; >+ return EVAL_PAGE; > } > > // Releases any resources we may have (or inherit) >+ > @Override > public void release() { >- init(); >+ init(); > } > > //********************************************************************* > // Support for parameter management > >- /** >+ /** > * Provides support for aggregating query parameters in URLs. > * Specifically, accepts a series of parameters, ensuring that >- * - newer parameters will precede older ones in the output URL >- * - all supplied parameters precede those in the input URL >+ * - newer parameters will precede older ones in the output URL >+ * - all supplied parameters precede those in the input URL > */ > public static class ParamManager { > > //********************************* > // Private state > >- private List names = new LinkedList(); >+ private List names = new LinkedList(); > private List values = new LinkedList(); >- private boolean done = false; >- >- //********************************* >+ private boolean done = false; >+ >+ //********************************* > // Public interface > >- /** Adds a new parameter to the list. */ >+ /** >+ * Adds a new parameter to the list. >+ */ > public void addParameter(String name, String value) { >- if (done) >- throw new IllegalStateException(); >- if (name != null) { >- names.add(name); >- if (value != null) >- values.add(value); >- else >- values.add(""); >- } >- } >+ if (done) { >+ throw new IllegalStateException(); >+ } >+ if (name != null) { >+ names.add(name); >+ if (value != null) { >+ values.add(value); >+ } else { >+ values.add(""); >+ } >+ } >+ } > >- /** >+ /** > * Produces a new URL with the stored parameters, in the appropriate > * order. > */ >- public String aggregateParams(String url) { >- /* >- * Since for efficiency we're destructive to the param lists, >- * we don't want to run multiple times. >- */ >- if (done) >- throw new IllegalStateException(); >- done = true; >+ public String aggregateParams(String url) { >+ /* >+ * Since for efficiency we're destructive to the param lists, >+ * we don't want to run multiple times. >+ */ >+ if (done) { >+ throw new IllegalStateException(); >+ } >+ done = true; > >- //// reverse the order of our two lists >- // Collections.reverse(this.names); >- // Collections.reverse(this.values); >+ //// reverse the order of our two lists >+ // Collections.reverse(this.names); >+ // Collections.reverse(this.values); > >- // build a string from the parameter list >- StringBuffer newParams = new StringBuffer(); >- for (int i = 0; i < names.size(); i++) { >- newParams.append(names.get(i) + "=" + values.get(i)); >- if (i < (names.size() - 1)) >- newParams.append("&"); >- } >+ // build a string from the parameter list >+ StringBuffer newParams = new StringBuffer(); >+ for (int i = 0; i < names.size(); i++) { >+ newParams.append(names.get(i) + "=" + values.get(i)); >+ if (i < (names.size() - 1)) { >+ newParams.append("&"); >+ } >+ } > >- // insert these parameters into the URL as appropriate >- if (newParams.length() > 0) { >- int questionMark = url.indexOf('?'); >- if (questionMark == -1) { >- return (url + "?" + newParams); >- } else { >- StringBuffer workingUrl = new StringBuffer(url); >- workingUrl.insert(questionMark + 1, (newParams + "&")); >- return workingUrl.toString(); >- } >- } else { >- return url; >- } >- } >+ // insert these parameters into the URL as appropriate >+ if (newParams.length() > 0) { >+ int questionMark = url.indexOf('?'); >+ if (questionMark == -1) { >+ return (url + "?" + newParams); >+ } else { >+ StringBuffer workingUrl = new StringBuffer(url); >+ workingUrl.insert(questionMark + 1, (newParams + "&")); >+ return workingUrl.toString(); >+ } >+ } else { >+ return url; >+ } >+ } > } > } >Index: src/main/java/org/apache/taglibs/standard/tag/common/core/RedirectSupport.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/tag/common/core/RedirectSupport.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/tag/common/core/RedirectSupport.java (working copy) >@@ -13,7 +13,7 @@ > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. >- */ >+ */ > > package org.apache.taglibs.standard.tag.common.core; > >@@ -31,7 +31,7 @@ > */ > > public abstract class RedirectSupport extends BodyTagSupport >- implements ParamParent { >+ implements ParamParent { > > //********************************************************************* > // Protected state >@@ -43,25 +43,25 @@ > // Private state > > private String var; // 'var' attribute >- private int scope; // processed 'scope' attr >- private ParamSupport.ParamManager params; // added parameters >+ private int scope; // processed 'scope' attr >+ private ParamSupport.ParamManager params; // added parameters > > //********************************************************************* > // Constructor and initialization > > public RedirectSupport() { >- super(); >- init(); >+ super(); >+ init(); > } > > private void init() { >- url = var = null; >- params = null; >- scope = PageContext.PAGE_SCOPE; >+ url = var = null; >+ params = null; >+ scope = PageContext.PAGE_SCOPE; > } > > >- //********************************************************************* >+ //********************************************************************* > // Tag attributes known at translation time > > public void setVar(String var) { >@@ -69,7 +69,7 @@ > } > > public void setScope(String scope) { >- this.scope = Util.getScope(scope); >+ this.scope = Util.getScope(scope); > } > > >@@ -77,8 +77,9 @@ > // Collaboration with subtags > > // inherit Javadoc >+ > public void addParameter(String name, String value) { >- params.addParameter(name, value); >+ params.addParameter(name, value); > } > > >@@ -86,41 +87,45 @@ > // Tag logic > > // resets any parameters that might be sent >+ > @Override > public int doStartTag() throws JspException { >- params = new ParamSupport.ParamManager(); >- return EVAL_BODY_BUFFERED; >+ params = new ParamSupport.ParamManager(); >+ return EVAL_BODY_BUFFERED; > } > > > // gets the right value, encodes it, and prints or stores it >+ > @Override > public int doEndTag() throws JspException { >- String result; // the eventual result >+ String result; // the eventual result > >- // add (already encoded) parameters >+ // add (already encoded) parameters > String baseUrl = UrlSupport.resolveUrl(url, context, pageContext); > result = params.aggregateParams(baseUrl); > > // if the URL is relative, rewrite it with 'redirect' encoding rules > HttpServletResponse response = >- ((HttpServletResponse) pageContext.getResponse()); >- if (!ImportSupport.isAbsoluteUrl(result)) >+ ((HttpServletResponse) pageContext.getResponse()); >+ if (!ImportSupport.isAbsoluteUrl(result)) { > result = response.encodeRedirectURL(result); >+ } > >- // redirect! >- try { >- response.sendRedirect(result); >- } catch (java.io.IOException ex) { >- throw new JspTagException(ex.toString(), ex); >- } >+ // redirect! >+ try { >+ response.sendRedirect(result); >+ } catch (java.io.IOException ex) { >+ throw new JspTagException(ex.toString(), ex); >+ } > >- return SKIP_PAGE; >+ return SKIP_PAGE; > } > > // Releases any resources we may have (or inherit) >+ > @Override > public void release() { >- init(); >+ init(); > } > } >Index: src/main/java/org/apache/taglibs/standard/util/EscapeXML.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/util/EscapeXML.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/util/EscapeXML.java (working copy) >@@ -16,16 +16,17 @@ > */ > package org.apache.taglibs.standard.util; > >-import javax.servlet.jsp.JspWriter; > import java.io.IOException; > import java.io.Reader; > >+import javax.servlet.jsp.JspWriter; >+ > /** > * Handles escaping of characters that could be interpreted as XML markup. >- * >+ * <p/> > * The specification for <code><c:out></code> defines the following > * character conversions to be applied: >- * >+ * <p/> > * <table rules="all" frame="border"> > * <thead align="center"> > * <tr><th>Character</th><th>Character Entity Code</th></tr> >@@ -42,6 +43,7 @@ > public class EscapeXML { > > private static final String[] ESCAPES; >+ > static { > int size = '>' + 1; // '>' is the largest escaped value > ESCAPES = new String[size]; >@@ -100,9 +102,10 @@ > > /** > * Emit the supplied object to the specified writer, escaping characters if needed. >- * @param src the object to write >+ * >+ * @param src the object to write > * @param escapeXml if true, escape unsafe characters before writing >- * @param out the JspWriter to emit to >+ * @param out the JspWriter to emit to > * @throws IOException if there was a problem emitting the content > */ > public static void emit(Object src, boolean escapeXml, JspWriter out) throws IOException { >@@ -115,9 +118,10 @@ > > /** > * Emit the supplied String to the specified writer, escaping characters if needed. >- * @param src the String to write >+ * >+ * @param src the String to write > * @param escapeXml if true, escape unsafe characters before writing >- * @param out the JspWriter to emit to >+ * @param out the JspWriter to emit to > * @throws IOException if there was a problem emitting the content > */ > public static void emit(String src, boolean escapeXml, JspWriter out) throws IOException { >@@ -138,27 +142,27 @@ > public static void emit(String src, JspWriter out) throws IOException { > int end = src.length(); > int from = 0; >- for (int to = from ; to < end; to++) { >+ for (int to = from; to < end; to++) { > String escape = getEscape(src.charAt(to)); > if (escape != null) { > if (to != from) { >- out.write(src, from, to-from); >+ out.write(src, from, to - from); > } > out.write(escape); > from = to + 1; > } > } > if (from != end) { >- out.write(src, from, end-from); >+ out.write(src, from, end - from); > } > } > > /** > * Copy the content of a Reader into the specified JSPWriter escaping characters if needed. > * >- * @param src the Reader to read from >+ * @param src the Reader to read from > * @param escapeXml if true, escape characters >- * @param out the JspWriter to emit to >+ * @param out the JspWriter to emit to > * @throws IOException if there was a problem emitting the content > */ > public static void emit(Reader src, boolean escapeXml, JspWriter out) throws IOException { >@@ -181,25 +185,25 @@ > * Emit escaped content into the specified JSPWriter. > * > * @param buffer characters to escape >- * @param from start position in the buffer >- * @param count number of characters to emit >- * @param out the JspWriter to emit to >+ * @param from start position in the buffer >+ * @param count number of characters to emit >+ * @param out the JspWriter to emit to > * @throws IOException if there was a problem emitting the content > */ > public static void emit(char[] buffer, int from, int count, JspWriter out) throws IOException { > int end = from + count; >- for (int to = from ; to < end; to++) { >+ for (int to = from; to < end; to++) { > String escape = getEscape(buffer[to]); > if (escape != null) { > if (to != from) { >- out.write(buffer, from, to-from); >+ out.write(buffer, from, to - from); > } > out.write(escape); > from = to + 1; > } > } > if (from != end) { >- out.write(buffer, from, end-from); >+ out.write(buffer, from, end - from); > } > } > } >Index: src/main/java/org/apache/taglibs/standard/util/ExpressionUtil.java >=================================================================== >--- src/main/java/org/apache/taglibs/standard/util/ExpressionUtil.java (revision 1034807) >+++ src/main/java/org/apache/taglibs/standard/util/ExpressionUtil.java (working copy) >@@ -30,8 +30,8 @@ > /** > * Create a value expression. > * >- * @param pageContext the context in which the expression will be parsed >- * @param expression the expression >+ * @param pageContext the context in which the expression will be parsed >+ * @param expression the expression > * @param expectedType the expected type of result > * @return a parsed expression > */ >Index: src/main/resources/META-INF/sql-1_0-rt.tld >=================================================================== >--- src/main/resources/META-INF/sql-1_0-rt.tld (revision 1034807) >+++ src/main/resources/META-INF/sql-1_0-rt.tld (working copy) >@@ -1,188 +1,188 @@ > <?xml version="1.0" encoding="ISO-8859-1" ?> > <!DOCTYPE taglib >- PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" >- "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd"> >+ PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" >+ "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd"> > <taglib> >- <tlib-version>1.0</tlib-version> >- <jsp-version>1.2</jsp-version> >- <short-name>sql_rt</short-name> >- <uri>http://java.sun.com/jstl/sql_rt</uri> >- <display-name>JSTL sql RT</display-name> >- <description>JSTL 1.0 sql library</description> >+ <tlib-version>1.0</tlib-version> >+ <jsp-version>1.2</jsp-version> >+ <short-name>sql_rt</short-name> >+ <uri>http://java.sun.com/jstl/sql_rt</uri> >+ <display-name>JSTL sql RT</display-name> >+ <description>JSTL 1.0 sql library</description> > >- <validator> >- <validator-class> >- org.apache.taglibs.standard.tlv.JstlSqlTLV >- </validator-class> >- <description> >- Provides core validation features for JSTL tags. >- </description> >- </validator> >+ <validator> >+ <validator-class> >+ org.apache.taglibs.standard.tlv.JstlSqlTLV >+ </validator-class> >+ <description> >+ Provides core validation features for JSTL tags. >+ </description> >+ </validator> > >- <tag> >- <name>transaction</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.sql.TransactionTag</tag-class> >- <body-content>JSP</body-content> >- <description> >- Provides nested database action elements with a shared Connection, >- set up to execute all statements as one transaction. >- </description> >- <attribute> >- <name>dataSource</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>isolation</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>transaction</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.sql.TransactionTag</tag-class> >+ <body-content>JSP</body-content> >+ <description> >+ Provides nested database action elements with a shared Connection, >+ set up to execute all statements as one transaction. >+ </description> >+ <attribute> >+ <name>dataSource</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>isolation</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <name>query</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.sql.QueryTag</tag-class> >- <body-content>JSP</body-content> >- <description> >- Executes the SQL query defined in its body or through the >- sql attribute. >- </description> >- <attribute> >- <name>var</name> >- <required>true</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>sql</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>dataSource</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>startRow</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>maxRows</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>query</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.sql.QueryTag</tag-class> >+ <body-content>JSP</body-content> >+ <description> >+ Executes the SQL query defined in its body or through the >+ sql attribute. >+ </description> >+ <attribute> >+ <name>var</name> >+ <required>true</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>sql</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>dataSource</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>startRow</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>maxRows</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <name>update</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.sql.UpdateTag</tag-class> >- <body-content>JSP</body-content> >- <description> >- Executes the SQL update defined in its body or through the >- sql attribute. >- </description> >- <attribute> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>sql</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>dataSource</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>update</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.sql.UpdateTag</tag-class> >+ <body-content>JSP</body-content> >+ <description> >+ Executes the SQL update defined in its body or through the >+ sql attribute. >+ </description> >+ <attribute> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>sql</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>dataSource</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <name>param</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.sql.ParamTag</tag-class> >- <body-content>JSP</body-content> >- <description> >- Sets a parameter in an SQL statement to the specified value. >- </description> >- <attribute> >- <name>value</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>param</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.sql.ParamTag</tag-class> >+ <body-content>JSP</body-content> >+ <description> >+ Sets a parameter in an SQL statement to the specified value. >+ </description> >+ <attribute> >+ <name>value</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <name>dateParam</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.sql.DateParamTag</tag-class> >- <body-content>empty</body-content> >- <description> >- Sets a parameter in an SQL statement to the specified java.util.Date value. >- </description> >- <attribute> >- <name>value</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>type</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>dateParam</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.sql.DateParamTag</tag-class> >+ <body-content>empty</body-content> >+ <description> >+ Sets a parameter in an SQL statement to the specified java.util.Date value. >+ </description> >+ <attribute> >+ <name>value</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>type</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <name>setDataSource</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.sql.SetDataSourceTag</tag-class> >- <body-content>empty</body-content> >- <description> >- Creates a simple DataSource suitable only for prototyping. >- </description> >- <attribute> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>dataSource</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>driver</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>url</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>user</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>password</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>setDataSource</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.sql.SetDataSourceTag</tag-class> >+ <body-content>empty</body-content> >+ <description> >+ Creates a simple DataSource suitable only for prototyping. >+ </description> >+ <attribute> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>dataSource</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>driver</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>url</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>user</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>password</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > </taglib> >Index: src/main/resources/META-INF/sql.tld >=================================================================== >--- src/main/resources/META-INF/sql.tld (revision 1034807) >+++ src/main/resources/META-INF/sql.tld (working copy) >@@ -1,289 +1,289 @@ > <?xml version="1.0" encoding="UTF-8" ?> > > <taglib xmlns="http://java.sun.com/xml/ns/j2ee" >- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" >- version="2.0"> >- >- <description>JSTL 1.1 sql library</description> >- <display-name>JSTL sql</display-name> >- <tlib-version>1.1</tlib-version> >- <short-name>sql</short-name> >- <uri>http://java.sun.com/jsp/jstl/sql</uri> >+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" >+ version="2.0"> > >- <validator> >- <description> >- Provides core validation features for JSTL tags. >- </description> >- <validator-class> >- org.apache.taglibs.standard.tlv.JstlSqlTLV >- </validator-class> >- </validator> >+ <description>JSTL 1.1 sql library</description> >+ <display-name>JSTL sql</display-name> >+ <tlib-version>1.1</tlib-version> >+ <short-name>sql</short-name> >+ <uri>http://java.sun.com/jsp/jstl/sql</uri> > >- <tag> >- <description> >- Provides nested database action elements with a shared Connection, >- set up to execute all statements as one transaction. >- </description> >- <name>transaction</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.sql.TransactionTag</tag-class> >- <body-content>JSP</body-content> >- <attribute> >+ <validator> > <description> >-DataSource associated with the database to access. A >-String value represents a relative path to a JNDI >-resource or the parameters for the JDBC >-DriverManager facility. >+ Provides core validation features for JSTL tags. > </description> >- <name>dataSource</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >+ <validator-class> >+ org.apache.taglibs.standard.tlv.JstlSqlTLV >+ </validator-class> >+ </validator> >+ >+ <tag> > <description> >-Transaction isolation level. If not specified, it is the >-isolation level the DataSource has been configured >-with. >+ Provides nested database action elements with a shared Connection, >+ set up to execute all statements as one transaction. > </description> >- <name>isolation</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <name>transaction</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.sql.TransactionTag</tag-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ DataSource associated with the database to access. A >+ String value represents a relative path to a JNDI >+ resource or the parameters for the JDBC >+ DriverManager facility. >+ </description> >+ <name>dataSource</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Transaction isolation level. If not specified, it is the >+ isolation level the DataSource has been configured >+ with. >+ </description> >+ <name>isolation</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- Executes the SQL query defined in its body or through the >- sql attribute. >- </description> >- <name>query</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.sql.QueryTag</tag-class> >- <body-content>JSP</body-content> >- <attribute> >+ <tag> > <description> >-Name of the exported scoped variable for the >-query result. The type of the scoped variable is >-javax.servlet.jsp.jstl.sql. >-Result (see Chapter 16 "Java APIs"). >+ Executes the SQL query defined in its body or through the >+ sql attribute. > </description> >- <name>var</name> >- <required>true</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Scope of var. >- </description> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-SQL query statement. >- </description> >- <name>sql</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Data source associated with the database to >-query. A String value represents a relative path >-to a JNDI resource or the parameters for the >-DriverManager class. >- </description> >- <name>dataSource</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-The returned Result object includes the rows >-starting at the specified index. The first row of >-the original query result set is at index 0. If not >-specified, rows are included starting from the >-first row at index 0. >- </description> >- <name>startRow</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-The maximum number of rows to be included in >-the query result. If not specified, or set to -1, no >-limit on the maximum number of rows is >-enforced. >- </description> >- <name>maxRows</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <name>query</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.sql.QueryTag</tag-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ Name of the exported scoped variable for the >+ query result. The type of the scoped variable is >+ javax.servlet.jsp.jstl.sql. >+ Result (see Chapter 16 "Java APIs"). >+ </description> >+ <name>var</name> >+ <required>true</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Scope of var. >+ </description> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ SQL query statement. >+ </description> >+ <name>sql</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Data source associated with the database to >+ query. A String value represents a relative path >+ to a JNDI resource or the parameters for the >+ DriverManager class. >+ </description> >+ <name>dataSource</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ The returned Result object includes the rows >+ starting at the specified index. The first row of >+ the original query result set is at index 0. If not >+ specified, rows are included starting from the >+ first row at index 0. >+ </description> >+ <name>startRow</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ The maximum number of rows to be included in >+ the query result. If not specified, or set to -1, no >+ limit on the maximum number of rows is >+ enforced. >+ </description> >+ <name>maxRows</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- Executes the SQL update defined in its body or through the >- sql attribute. >- </description> >- <name>update</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.sql.UpdateTag</tag-class> >- <body-content>JSP</body-content> >- <attribute> >+ <tag> > <description> >-Name of the exported scoped variable for the result >-of the database update. The type of the scoped >-variable is java.lang.Integer. >+ Executes the SQL update defined in its body or through the >+ sql attribute. > </description> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Scope of var. >- </description> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-SQL update statement. >- </description> >- <name>sql</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Data source associated with the database to update. >-A String value represents a relative path to a JNDI >-resource or the parameters for the JDBC >-DriverManager class. >- </description> >- <name>dataSource</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <name>update</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.sql.UpdateTag</tag-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ Name of the exported scoped variable for the result >+ of the database update. The type of the scoped >+ variable is java.lang.Integer. >+ </description> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Scope of var. >+ </description> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ SQL update statement. >+ </description> >+ <name>sql</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Data source associated with the database to update. >+ A String value represents a relative path to a JNDI >+ resource or the parameters for the JDBC >+ DriverManager class. >+ </description> >+ <name>dataSource</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- Sets a parameter in an SQL statement to the specified value. >- </description> >- <name>param</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.sql.ParamTag</tag-class> >- <body-content>JSP</body-content> >- <attribute> >+ <tag> > <description> >-Parameter value. >+ Sets a parameter in an SQL statement to the specified value. > </description> >- <name>value</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <name>param</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.sql.ParamTag</tag-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ Parameter value. >+ </description> >+ <name>value</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- Sets a parameter in an SQL statement to the specified java.util.Date value. >- </description> >- <name>dateParam</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.sql.DateParamTag</tag-class> >- <body-content>empty</body-content> >- <attribute> >+ <tag> > <description> >-Parameter value for DATE, TIME, or >-TIMESTAMP column in a database table. >+ Sets a parameter in an SQL statement to the specified java.util.Date value. > </description> >- <name>value</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-One of "date", "time" or "timestamp". >- </description> >- <name>type</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <name>dateParam</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.sql.DateParamTag</tag-class> >+ <body-content>empty</body-content> >+ <attribute> >+ <description> >+ Parameter value for DATE, TIME, or >+ TIMESTAMP column in a database table. >+ </description> >+ <name>value</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ One of "date", "time" or "timestamp". >+ </description> >+ <name>type</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- Creates a simple DataSource suitable only for prototyping. >- </description> >- <name>setDataSource</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.sql.SetDataSourceTag</tag-class> >- <body-content>empty</body-content> >- <attribute> >+ <tag> > <description> >-Name of the exported scoped variable >-for the data source specified. Type can >-be String or DataSource. >+ Creates a simple DataSource suitable only for prototyping. > </description> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-If var is specified, scope of the >-exported variable. Otherwise, scope of >-the data source configuration variable. >- </description> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Data source. If specified as a string, it >-can either be a relative path to a JNDI >-resource, or a JDBC parameters string >-as defined in Section 10.1.1. >- </description> >- <name>dataSource</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-JDBC parameter: driver class name. >- </description> >- <name>driver</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-JDBC parameter: URL associated with >-the database. >- </description> >- <name>url</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-JDBC parameter: database user on >-whose behalf the connection to the >-database is being made. >- </description> >- <name>user</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-JDBC parameter: user password >- </description> >- <name>password</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <name>setDataSource</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.sql.SetDataSourceTag</tag-class> >+ <body-content>empty</body-content> >+ <attribute> >+ <description> >+ Name of the exported scoped variable >+ for the data source specified. Type can >+ be String or DataSource. >+ </description> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ If var is specified, scope of the >+ exported variable. Otherwise, scope of >+ the data source configuration variable. >+ </description> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Data source. If specified as a string, it >+ can either be a relative path to a JNDI >+ resource, or a JDBC parameters string >+ as defined in Section 10.1.1. >+ </description> >+ <name>dataSource</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ JDBC parameter: driver class name. >+ </description> >+ <name>driver</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ JDBC parameter: URL associated with >+ the database. >+ </description> >+ <name>url</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ JDBC parameter: database user on >+ whose behalf the connection to the >+ database is being made. >+ </description> >+ <name>user</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ JDBC parameter: user password >+ </description> >+ <name>password</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > </taglib> >Index: src/main/resources/META-INF/c-1_1.tld >=================================================================== >--- src/main/resources/META-INF/c-1_1.tld (revision 1034807) >+++ src/main/resources/META-INF/c-1_1.tld (working copy) >@@ -1,563 +1,563 @@ > <?xml version="1.0" encoding="UTF-8" ?> > > <taglib xmlns="http://java.sun.com/xml/ns/j2ee" >- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" >- version="2.0"> >- >- <description>JSTL 1.1 core library</description> >- <display-name>JSTL core</display-name> >- <tlib-version>1.1</tlib-version> >- <short-name>c</short-name> >- <uri>http://java.sun.com/jsp/jstl/core_1_1</uri> >+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" >+ version="2.0"> > >- <validator> >- <description> >- Provides core validation features for JSTL tags. >- </description> >- <validator-class> >- org.apache.taglibs.standard.tlv.JstlCoreTLV >- </validator-class> >- </validator> >+ <description>JSTL 1.1 core library</description> >+ <display-name>JSTL core</display-name> >+ <tlib-version>1.1</tlib-version> >+ <short-name>c</short-name> >+ <uri>http://java.sun.com/jsp/jstl/core_1_1</uri> > >- <tag> >- <description> >- Catches any Throwable that occurs in its body and optionally >- exposes it. >- </description> >- <name>catch</name> >- <tag-class>org.apache.taglibs.standard.tag.common.core.CatchTag</tag-class> >- <body-content>JSP</body-content> >- <attribute> >+ <validator> > <description> >-Name of the exported scoped variable for the >-exception thrown from a nested action. The type of the >-scoped variable is the type of the exception thrown. >+ Provides core validation features for JSTL tags. > </description> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <validator-class> >+ org.apache.taglibs.standard.tlv.JstlCoreTLV >+ </validator-class> >+ </validator> > >- <tag> >- <description> >- Simple conditional tag that establishes a context for >- mutually exclusive conditional operations, marked by >- <when> and <otherwise> >- </description> >- <name>choose</name> >- <tag-class>org.apache.taglibs.standard.tag.common.core.ChooseTag</tag-class> >- <body-content>JSP</body-content> >- </tag> >- >- <tag> >- <description> >- Simple conditional tag, which evalutes its body if the >- supplied condition is true and optionally exposes a Boolean >- scripting variable representing the evaluation of this condition >- </description> >- <name>if</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.core.IfTag</tag-class> >- <body-content>JSP</body-content> >- <attribute> >+ <tag> > <description> >-The test condition that determines whether or >-not the body content should be processed. >+ Catches any Throwable that occurs in its body and optionally >+ exposes it. > </description> >- <name>test</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- <type>boolean</type> >- </attribute> >- <attribute> >+ <name>catch</name> >+ <tag-class>org.apache.taglibs.standard.tag.common.core.CatchTag</tag-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ Name of the exported scoped variable for the >+ exception thrown from a nested action. The type of the >+ scoped variable is the type of the exception thrown. >+ </description> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> >+ >+ <tag> > <description> >-Name of the exported scoped variable for the >-resulting value of the test condition. The type >-of the scoped variable is Boolean. >+ Simple conditional tag that establishes a context for >+ mutually exclusive conditional operations, marked by >+ <when> and <otherwise> > </description> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >+ <name>choose</name> >+ <tag-class>org.apache.taglibs.standard.tag.common.core.ChooseTag</tag-class> >+ <body-content>JSP</body-content> >+ </tag> >+ >+ <tag> > <description> >-Scope for var. >+ Simple conditional tag, which evalutes its body if the >+ supplied condition is true and optionally exposes a Boolean >+ scripting variable representing the evaluation of this condition > </description> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <name>if</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.core.IfTag</tag-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ The test condition that determines whether or >+ not the body content should be processed. >+ </description> >+ <name>test</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ <type>boolean</type> >+ </attribute> >+ <attribute> >+ <description> >+ Name of the exported scoped variable for the >+ resulting value of the test condition. The type >+ of the scoped variable is Boolean. >+ </description> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Scope for var. >+ </description> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- Retrieves an absolute or relative URL and exposes its contents >- to either the page, a String in 'var', or a Reader in 'varReader'. >- </description> >- <name>import</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.core.ImportTag</tag-class> >- <tei-class>org.apache.taglibs.standard.tei.ImportTEI</tei-class> >- <body-content>JSP</body-content> >- <attribute> >+ <tag> > <description> >-The URL of the resource to import. >+ Retrieves an absolute or relative URL and exposes its contents >+ to either the page, a String in 'var', or a Reader in 'varReader'. > </description> >- <name>url</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Name of the exported scoped variable for the >-resource's content. The type of the scoped >-variable is String. >- </description> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Scope for var. >- </description> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Name of the exported scoped variable for the >-resource's content. The type of the scoped >-variable is Reader. >- </description> >- <name>varReader</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Name of the context when accessing a relative >-URL resource that belongs to a foreign >-context. >- </description> >- <name>context</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Character encoding of the content at the input >-resource. >- </description> >- <name>charEncoding</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <name>import</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.core.ImportTag</tag-class> >+ <tei-class>org.apache.taglibs.standard.tei.ImportTEI</tei-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ The URL of the resource to import. >+ </description> >+ <name>url</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Name of the exported scoped variable for the >+ resource's content. The type of the scoped >+ variable is String. >+ </description> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Scope for var. >+ </description> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Name of the exported scoped variable for the >+ resource's content. The type of the scoped >+ variable is Reader. >+ </description> >+ <name>varReader</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Name of the context when accessing a relative >+ URL resource that belongs to a foreign >+ context. >+ </description> >+ <name>context</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Character encoding of the content at the input >+ resource. >+ </description> >+ <name>charEncoding</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- The basic iteration tag, accepting many different >- collection types and supporting subsetting and other >- functionality >- </description> >- <name>forEach</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.core.ForEachTag</tag-class> >- <tei-class>org.apache.taglibs.standard.tei.ForEachTEI</tei-class> >- <body-content>JSP</body-content> >- <attribute> >+ <tag> > <description> >-Collection of items to iterate over. >+ The basic iteration tag, accepting many different >+ collection types and supporting subsetting and other >+ functionality > </description> >- <name>items</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- <type>java.lang.Object</type> >- </attribute> >- <attribute> >- <description> >-If items specified: >-Iteration begins at the item located at the >-specified index. First item of the collection has >-index 0. >-If items not specified: >-Iteration begins with index set at the value >-specified. >- </description> >- <name>begin</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- <type>int</type> >- </attribute> >- <attribute> >- <description> >-If items specified: >-Iteration ends at the item located at the >-specified index (inclusive). >-If items not specified: >-Iteration ends when index reaches the value >-specified. >- </description> >- <name>end</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- <type>int</type> >- </attribute> >- <attribute> >- <description> >-Iteration will only process every step items of >-the collection, starting with the first one. >- </description> >- <name>step</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- <type>int</type> >- </attribute> >- <attribute> >- <description> >-Name of the exported scoped variable for the >-current item of the iteration. This scoped >-variable has nested visibility. Its type depends >-on the object of the underlying collection. >- </description> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Name of the exported scoped variable for the >-status of the iteration. Object exported is of type >-javax.servlet.jsp.jstl.core.LoopTagStatus. This scoped variable has nested >-visibility. >- </description> >- <name>varStatus</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <name>forEach</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.core.ForEachTag</tag-class> >+ <tei-class>org.apache.taglibs.standard.tei.ForEachTEI</tei-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ Collection of items to iterate over. >+ </description> >+ <name>items</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ <type>java.lang.Object</type> >+ </attribute> >+ <attribute> >+ <description> >+ If items specified: >+ Iteration begins at the item located at the >+ specified index. First item of the collection has >+ index 0. >+ If items not specified: >+ Iteration begins with index set at the value >+ specified. >+ </description> >+ <name>begin</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ <type>int</type> >+ </attribute> >+ <attribute> >+ <description> >+ If items specified: >+ Iteration ends at the item located at the >+ specified index (inclusive). >+ If items not specified: >+ Iteration ends when index reaches the value >+ specified. >+ </description> >+ <name>end</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ <type>int</type> >+ </attribute> >+ <attribute> >+ <description> >+ Iteration will only process every step items of >+ the collection, starting with the first one. >+ </description> >+ <name>step</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ <type>int</type> >+ </attribute> >+ <attribute> >+ <description> >+ Name of the exported scoped variable for the >+ current item of the iteration. This scoped >+ variable has nested visibility. Its type depends >+ on the object of the underlying collection. >+ </description> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Name of the exported scoped variable for the >+ status of the iteration. Object exported is of type >+ javax.servlet.jsp.jstl.core.LoopTagStatus. This scoped variable has nested >+ visibility. >+ </description> >+ <name>varStatus</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- Iterates over tokens, separated by the supplied delimeters >- </description> >- <name>forTokens</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.core.ForTokensTag</tag-class> >- <body-content>JSP</body-content> >- <attribute> >+ <tag> > <description> >-String of tokens to iterate over. >+ Iterates over tokens, separated by the supplied delimeters > </description> >- <name>items</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- <type>java.lang.String</type> >- </attribute> >- <attribute> >- <description> >-The set of delimiters (the characters that >-separate the tokens in the string). >- </description> >- <name>delims</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- <type>java.lang.String</type> >- </attribute> >- <attribute> >- <description> >-Iteration begins at the token located at the >-specified index. First token has index 0. >- </description> >- <name>begin</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- <type>int</type> >- </attribute> >- <attribute> >- <description> >-Iteration ends at the token located at the >-specified index (inclusive). >- </description> >- <name>end</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- <type>int</type> >- </attribute> >- <attribute> >- <description> >-Iteration will only process every step tokens >-of the string, starting with the first one. >- </description> >- <name>step</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- <type>int</type> >- </attribute> >- <attribute> >- <description> >-Name of the exported scoped variable for the >-current item of the iteration. This scoped >-variable has nested visibility. >- </description> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Name of the exported scoped variable for the >-status of the iteration. Object exported is of >-type >-javax.servlet.jsp.jstl.core.LoopTag >-Status. This scoped variable has nested >-visibility. >- </description> >- <name>varStatus</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <name>forTokens</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.core.ForTokensTag</tag-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ String of tokens to iterate over. >+ </description> >+ <name>items</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ <type>java.lang.String</type> >+ </attribute> >+ <attribute> >+ <description> >+ The set of delimiters (the characters that >+ separate the tokens in the string). >+ </description> >+ <name>delims</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ <type>java.lang.String</type> >+ </attribute> >+ <attribute> >+ <description> >+ Iteration begins at the token located at the >+ specified index. First token has index 0. >+ </description> >+ <name>begin</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ <type>int</type> >+ </attribute> >+ <attribute> >+ <description> >+ Iteration ends at the token located at the >+ specified index (inclusive). >+ </description> >+ <name>end</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ <type>int</type> >+ </attribute> >+ <attribute> >+ <description> >+ Iteration will only process every step tokens >+ of the string, starting with the first one. >+ </description> >+ <name>step</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ <type>int</type> >+ </attribute> >+ <attribute> >+ <description> >+ Name of the exported scoped variable for the >+ current item of the iteration. This scoped >+ variable has nested visibility. >+ </description> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Name of the exported scoped variable for the >+ status of the iteration. Object exported is of >+ type >+ javax.servlet.jsp.jstl.core.LoopTag >+ Status. This scoped variable has nested >+ visibility. >+ </description> >+ <name>varStatus</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- Like <%= ... >, but for expressions. >- </description> >- <name>out</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.core.OutTag</tag-class> >- <body-content>JSP</body-content> >- <attribute> >+ <tag> > <description> >-Expression to be evaluated. >+ Like <%= ... >, but for expressions. > </description> >- <name>value</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Default value if the resulting value is null. >- </description> >- <name>default</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Determines whether characters <,>,&,'," in the >-resulting string should be converted to their >-corresponding character entity codes. Default value is >-true. >- </description> >- <name>escapeXml</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <name>out</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.core.OutTag</tag-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ Expression to be evaluated. >+ </description> >+ <name>value</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Default value if the resulting value is null. >+ </description> >+ <name>default</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Determines whether characters <,>,&,'," in the >+ resulting string should be converted to their >+ corresponding character entity codes. Default value is >+ true. >+ </description> >+ <name>escapeXml</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > > >- <tag> >- <description> >- Subtag of <choose> that follows <when> tags >- and runs only if all of the prior conditions evaluated to >- 'false' >- </description> >- <name>otherwise</name> >- <tag-class>org.apache.taglibs.standard.tag.common.core.OtherwiseTag</tag-class> >- <body-content>JSP</body-content> >- </tag> >- >- <tag> >- <description> >- Adds a parameter to a containing 'import' tag's URL. >- </description> >- <name>param</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.core.ParamTag</tag-class> >- <body-content>JSP</body-content> >- <attribute> >+ <tag> > <description> >-Name of the query string parameter. >+ Subtag of <choose> that follows <when> tags >+ and runs only if all of the prior conditions evaluated to >+ 'false' > </description> >- <name>name</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >+ <name>otherwise</name> >+ <tag-class>org.apache.taglibs.standard.tag.common.core.OtherwiseTag</tag-class> >+ <body-content>JSP</body-content> >+ </tag> >+ >+ <tag> > <description> >-Value of the parameter. >+ Adds a parameter to a containing 'import' tag's URL. > </description> >- <name>value</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <name>param</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.core.ParamTag</tag-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ Name of the query string parameter. >+ </description> >+ <name>name</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Value of the parameter. >+ </description> >+ <name>value</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- Redirects to a new URL. >- </description> >- <name>redirect</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.core.RedirectTag</tag-class> >- <body-content>JSP</body-content> >- <attribute> >+ <tag> > <description> >-The URL of the resource to redirect to. >+ Redirects to a new URL. > </description> >- <name>url</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Name of the context when redirecting to a relative URL >-resource that belongs to a foreign context. >- </description> >- <name>context</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <name>redirect</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.core.RedirectTag</tag-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ The URL of the resource to redirect to. >+ </description> >+ <name>url</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Name of the context when redirecting to a relative URL >+ resource that belongs to a foreign context. >+ </description> >+ <name>context</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- Removes a scoped variable (from a particular scope, if specified). >- </description> >- <name>remove</name> >- <tag-class>org.apache.taglibs.standard.tag.common.core.RemoveTag</tag-class> >- <body-content>empty</body-content> >- <attribute> >+ <tag> > <description> >-Name of the scoped variable to be removed. >+ Removes a scoped variable (from a particular scope, if specified). > </description> >- <name>var</name> >- <required>true</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Scope for var. >- </description> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <name>remove</name> >+ <tag-class>org.apache.taglibs.standard.tag.common.core.RemoveTag</tag-class> >+ <body-content>empty</body-content> >+ <attribute> >+ <description> >+ Name of the scoped variable to be removed. >+ </description> >+ <name>var</name> >+ <required>true</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Scope for var. >+ </description> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- Sets the result of an expression evaluation in a 'scope' >- </description> >- <name>set</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.core.SetTag</tag-class> >- <body-content>JSP</body-content> >- <attribute> >+ <tag> > <description> >-Name of the exported scoped variable to hold the value >-specified in the action. The type of the scoped variable is >-whatever type the value expression evaluates to. >+ Sets the result of an expression evaluation in a 'scope' > </description> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Expression to be evaluated. >- </description> >- <name>value</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Target object whose property will be set. Must evaluate to >-a JavaBeans object with setter property property, or to a >-java.util.Map object. >- </description> >- <name>target</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Name of the property to be set in the target object. >- </description> >- <name>property</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Scope for var. >- </description> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <name>set</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.core.SetTag</tag-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ Name of the exported scoped variable to hold the value >+ specified in the action. The type of the scoped variable is >+ whatever type the value expression evaluates to. >+ </description> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Expression to be evaluated. >+ </description> >+ <name>value</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Target object whose property will be set. Must evaluate to >+ a JavaBeans object with setter property property, or to a >+ java.util.Map object. >+ </description> >+ <name>target</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Name of the property to be set in the target object. >+ </description> >+ <name>property</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Scope for var. >+ </description> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- Creates a URL with optional query parameters. >- </description> >- <name>url</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.core.UrlTag</tag-class> >- <body-content>JSP</body-content> >- <attribute> >+ <tag> > <description> >-Name of the exported scoped variable for the >-processed url. The type of the scoped variable is >-String. >+ Creates a URL with optional query parameters. > </description> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Scope for var. >- </description> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-URL to be processed. >- </description> >- <name>value</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Name of the context when specifying a relative URL >-resource that belongs to a foreign context. >- </description> >- <name>context</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <name>url</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.core.UrlTag</tag-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ Name of the exported scoped variable for the >+ processed url. The type of the scoped variable is >+ String. >+ </description> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Scope for var. >+ </description> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ URL to be processed. >+ </description> >+ <name>value</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Name of the context when specifying a relative URL >+ resource that belongs to a foreign context. >+ </description> >+ <name>context</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- Subtag of <choose> that includes its body if its >- condition evalutes to 'true' >- </description> >- <name>when</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.core.WhenTag</tag-class> >- <body-content>JSP</body-content> >- <attribute> >+ <tag> > <description> >-The test condition that determines whether or not the >-body content should be processed. >+ Subtag of <choose> that includes its body if its >+ condition evalutes to 'true' > </description> >- <name>test</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- <type>boolean</type> >- </attribute> >- </tag> >+ <name>when</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.core.WhenTag</tag-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ The test condition that determines whether or not the >+ body content should be processed. >+ </description> >+ <name>test</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ <type>boolean</type> >+ </attribute> >+ </tag> > > </taglib> >Index: src/main/resources/META-INF/c-1_0-rt.tld >=================================================================== >--- src/main/resources/META-INF/c-1_0-rt.tld (revision 1034807) >+++ src/main/resources/META-INF/c-1_0-rt.tld (working copy) >@@ -1,393 +1,393 @@ > <?xml version="1.0" encoding="ISO-8859-1" ?> > <!DOCTYPE taglib >- PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" >- "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd"> >+ PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" >+ "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd"> > <taglib> >- <tlib-version>1.0</tlib-version> >- <jsp-version>1.2</jsp-version> >- <short-name>c_rt</short-name> >- <uri>http://java.sun.com/jstl/core_rt</uri> >- <display-name>JSTL core RT</display-name> >- <description>JSTL 1.0 core library</description> >+ <tlib-version>1.0</tlib-version> >+ <jsp-version>1.2</jsp-version> >+ <short-name>c_rt</short-name> >+ <uri>http://java.sun.com/jstl/core_rt</uri> >+ <display-name>JSTL core RT</display-name> >+ <description>JSTL 1.0 core library</description> > >- <validator> >- <validator-class> >- org.apache.taglibs.standard.tlv.JstlCoreTLV >- </validator-class> >- <description> >- Provides core validation features for JSTL tags. >- </description> >- </validator> >+ <validator> >+ <validator-class> >+ org.apache.taglibs.standard.tlv.JstlCoreTLV >+ </validator-class> >+ <description> >+ Provides core validation features for JSTL tags. >+ </description> >+ </validator> > >- <tag> >- <name>catch</name> >- <tag-class>org.apache.taglibs.standard.tag.common.core.CatchTag</tag-class> >- <body-content>JSP</body-content> >- <description> >- Catches any Throwable that occurs in its body and optionally >- exposes it. >- </description> >- <attribute> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>catch</name> >+ <tag-class>org.apache.taglibs.standard.tag.common.core.CatchTag</tag-class> >+ <body-content>JSP</body-content> >+ <description> >+ Catches any Throwable that occurs in its body and optionally >+ exposes it. >+ </description> >+ <attribute> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <name>choose</name> >- <tag-class>org.apache.taglibs.standard.tag.common.core.ChooseTag</tag-class> >- <body-content>JSP</body-content> >- <description> >- Simple conditional tag that establishes a context for >- mutually exclusive conditional operations, marked by >- <when> and <otherwise> >- </description> >- </tag> >+ <tag> >+ <name>choose</name> >+ <tag-class>org.apache.taglibs.standard.tag.common.core.ChooseTag</tag-class> >+ <body-content>JSP</body-content> >+ <description> >+ Simple conditional tag that establishes a context for >+ mutually exclusive conditional operations, marked by >+ <when> and <otherwise> >+ </description> >+ </tag> > >- <tag> >- <name>if</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.core.IfTag</tag-class> >- <body-content>JSP</body-content> >- <description> >- Simple conditional tag, which evalutes its body if the >- supplied condition is true and optionally exposes a Boolean >- scripting variable representing the evaluation of this condition >- </description> >- <attribute> >- <name>test</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- <type>boolean</type> >- </attribute> >- <attribute> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>if</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.core.IfTag</tag-class> >+ <body-content>JSP</body-content> >+ <description> >+ Simple conditional tag, which evalutes its body if the >+ supplied condition is true and optionally exposes a Boolean >+ scripting variable representing the evaluation of this condition >+ </description> >+ <attribute> >+ <name>test</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ <type>boolean</type> >+ </attribute> >+ <attribute> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <name>import</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.core.ImportTag</tag-class> >- <tei-class>org.apache.taglibs.standard.tei.ImportTEI</tei-class> >- <body-content>JSP</body-content> >- <description> >- Retrieves an absolute or relative URL and exposes its contents >- to either the page, a String in 'var', or a Reader in 'varReader'. >- </description> >- <attribute> >- <name>url</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>varReader</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>context</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>charEncoding</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>import</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.core.ImportTag</tag-class> >+ <tei-class>org.apache.taglibs.standard.tei.ImportTEI</tei-class> >+ <body-content>JSP</body-content> >+ <description> >+ Retrieves an absolute or relative URL and exposes its contents >+ to either the page, a String in 'var', or a Reader in 'varReader'. >+ </description> >+ <attribute> >+ <name>url</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>varReader</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>context</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>charEncoding</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <name>forEach</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.core.ForEachTag</tag-class> >- <tei-class>org.apache.taglibs.standard.tei.ForEachTEI</tei-class> >- <body-content>JSP</body-content> >- <description> >- The basic iteration tag, accepting many different >- collection types and supporting subsetting and other >- functionality >- </description> >- <attribute> >- <name>items</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- <type>java.lang.Object</type> >- </attribute> >- <attribute> >- <name>begin</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- <type>int</type> >- </attribute> >- <attribute> >- <name>end</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- <type>int</type> >- </attribute> >- <attribute> >- <name>step</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- <type>int</type> >- </attribute> >- <attribute> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>varStatus</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>forEach</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.core.ForEachTag</tag-class> >+ <tei-class>org.apache.taglibs.standard.tei.ForEachTEI</tei-class> >+ <body-content>JSP</body-content> >+ <description> >+ The basic iteration tag, accepting many different >+ collection types and supporting subsetting and other >+ functionality >+ </description> >+ <attribute> >+ <name>items</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ <type>java.lang.Object</type> >+ </attribute> >+ <attribute> >+ <name>begin</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ <type>int</type> >+ </attribute> >+ <attribute> >+ <name>end</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ <type>int</type> >+ </attribute> >+ <attribute> >+ <name>step</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ <type>int</type> >+ </attribute> >+ <attribute> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>varStatus</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <name>forTokens</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.core.ForTokensTag</tag-class> >- <body-content>JSP</body-content> >- <description> >- Iterates over tokens, separated by the supplied delimeters >- </description> >- <attribute> >- <name>items</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- <type>java.lang.String</type> >- </attribute> >- <attribute> >- <name>delims</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- <type>java.lang.String</type> >- </attribute> >- <attribute> >- <name>begin</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- <type>int</type> >- </attribute> >- <attribute> >- <name>end</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- <type>int</type> >- </attribute> >- <attribute> >- <name>step</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- <type>int</type> >- </attribute> >- <attribute> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>varStatus</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>forTokens</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.core.ForTokensTag</tag-class> >+ <body-content>JSP</body-content> >+ <description> >+ Iterates over tokens, separated by the supplied delimeters >+ </description> >+ <attribute> >+ <name>items</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ <type>java.lang.String</type> >+ </attribute> >+ <attribute> >+ <name>delims</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ <type>java.lang.String</type> >+ </attribute> >+ <attribute> >+ <name>begin</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ <type>int</type> >+ </attribute> >+ <attribute> >+ <name>end</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ <type>int</type> >+ </attribute> >+ <attribute> >+ <name>step</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ <type>int</type> >+ </attribute> >+ <attribute> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>varStatus</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <name>out</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.core.OutTag</tag-class> >- <body-content>JSP</body-content> >- <description> >- Like <%= ... >, but for expressions. >- </description> >- <attribute> >- <name>value</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>default</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>escapeXml</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>out</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.core.OutTag</tag-class> >+ <body-content>JSP</body-content> >+ <description> >+ Like <%= ... >, but for expressions. >+ </description> >+ <attribute> >+ <name>value</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>default</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>escapeXml</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > > >- <tag> >- <name>otherwise</name> >- <tag-class>org.apache.taglibs.standard.tag.common.core.OtherwiseTag</tag-class> >- <body-content>JSP</body-content> >- <description> >- Subtag of <choose> that follows <when> tags >- and runs only if all of the prior conditions evaluated to >- 'false' >- </description> >- </tag> >+ <tag> >+ <name>otherwise</name> >+ <tag-class>org.apache.taglibs.standard.tag.common.core.OtherwiseTag</tag-class> >+ <body-content>JSP</body-content> >+ <description> >+ Subtag of <choose> that follows <when> tags >+ and runs only if all of the prior conditions evaluated to >+ 'false' >+ </description> >+ </tag> > >- <tag> >- <name>param</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.core.ParamTag</tag-class> >- <body-content>JSP</body-content> >- <description> >- Adds a parameter to a containing 'import' tag's URL. >- </description> >- <attribute> >- <name>name</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>value</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>param</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.core.ParamTag</tag-class> >+ <body-content>JSP</body-content> >+ <description> >+ Adds a parameter to a containing 'import' tag's URL. >+ </description> >+ <attribute> >+ <name>name</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>value</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <name>redirect</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.core.RedirectTag</tag-class> >- <body-content>JSP</body-content> >- <description> >- Redirects to a new URL. >- </description> >- <attribute> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>url</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>context</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>redirect</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.core.RedirectTag</tag-class> >+ <body-content>JSP</body-content> >+ <description> >+ Redirects to a new URL. >+ </description> >+ <attribute> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>url</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>context</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <name>remove</name> >- <tag-class>org.apache.taglibs.standard.tag.common.core.RemoveTag</tag-class> >- <body-content>empty</body-content> >- <description> >- Removes a scoped variable (from a particular scope, if specified). >- </description> >- <attribute> >- <name>var</name> >- <required>true</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>remove</name> >+ <tag-class>org.apache.taglibs.standard.tag.common.core.RemoveTag</tag-class> >+ <body-content>empty</body-content> >+ <description> >+ Removes a scoped variable (from a particular scope, if specified). >+ </description> >+ <attribute> >+ <name>var</name> >+ <required>true</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <name>set</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.core.SetTag</tag-class> >- <body-content>JSP</body-content> >- <description> >- Sets the result of an expression evaluation in a 'scope' >- </description> >- <attribute> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>value</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>target</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>property</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>set</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.core.SetTag</tag-class> >+ <body-content>JSP</body-content> >+ <description> >+ Sets the result of an expression evaluation in a 'scope' >+ </description> >+ <attribute> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>value</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>target</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>property</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <name>url</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.core.UrlTag</tag-class> >- <body-content>JSP</body-content> >- <description> >- Creates a URL with optional query parameters. >- </description> >- <attribute> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>value</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>context</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>url</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.core.UrlTag</tag-class> >+ <body-content>JSP</body-content> >+ <description> >+ Creates a URL with optional query parameters. >+ </description> >+ <attribute> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>value</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>context</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <name>when</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.core.WhenTag</tag-class> >- <body-content>JSP</body-content> >- <description> >- Subtag of <choose> that includes its body if its >- condition evalutes to 'true' >- </description> >- <attribute> >- <name>test</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- <type>boolean</type> >- </attribute> >- </tag> >+ <tag> >+ <name>when</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.core.WhenTag</tag-class> >+ <body-content>JSP</body-content> >+ <description> >+ Subtag of <choose> that includes its body if its >+ condition evalutes to 'true' >+ </description> >+ <attribute> >+ <name>test</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ <type>boolean</type> >+ </attribute> >+ </tag> > > </taglib> >Index: src/main/resources/META-INF/c.tld >=================================================================== >--- src/main/resources/META-INF/c.tld (revision 1034807) >+++ src/main/resources/META-INF/c.tld (working copy) >@@ -1,572 +1,572 @@ > <?xml version="1.0" encoding="UTF-8" ?> > > <taglib xmlns="http://java.sun.com/xml/ns/javaee" >- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd" >- version="2.1"> >+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd" >+ version="2.1"> > >- <description>JSTL 1.2 core library</description> >- <display-name>JSTL core</display-name> >- <tlib-version>1.2</tlib-version> >- <short-name>c</short-name> >- <uri>http://java.sun.com/jsp/jstl/core</uri> >+ <description>JSTL 1.2 core library</description> >+ <display-name>JSTL core</display-name> >+ <tlib-version>1.2</tlib-version> >+ <short-name>c</short-name> >+ <uri>http://java.sun.com/jsp/jstl/core</uri> > >- <validator> >- <description> >- Provides core validation features for JSTL tags. >- </description> >- <validator-class> >- org.apache.taglibs.standard.tlv.JstlCoreTLV >- </validator-class> >- </validator> >- >- <tag> >- <description> >- Catches any Throwable that occurs in its body and optionally >- exposes it. >- </description> >- <name>catch</name> >- <tag-class>org.apache.taglibs.standard.tag.common.core.CatchTag</tag-class> >- <body-content>JSP</body-content> >- <attribute> >+ <validator> > <description> >-Name of the exported scoped variable for the >-exception thrown from a nested action. The type of the >-scoped variable is the type of the exception thrown. >+ Provides core validation features for JSTL tags. > </description> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <validator-class> >+ org.apache.taglibs.standard.tlv.JstlCoreTLV >+ </validator-class> >+ </validator> > >- <tag> >- <description> >- Simple conditional tag that establishes a context for >- mutually exclusive conditional operations, marked by >- <when> and <otherwise> >- </description> >- <name>choose</name> >- <tag-class>org.apache.taglibs.standard.tag.common.core.ChooseTag</tag-class> >- <body-content>JSP</body-content> >- </tag> >- >- <tag> >- <description> >- Simple conditional tag, which evalutes its body if the >- supplied condition is true and optionally exposes a Boolean >- scripting variable representing the evaluation of this condition >- </description> >- <name>if</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.core.IfTag</tag-class> >- <body-content>JSP</body-content> >- <attribute> >+ <tag> > <description> >-The test condition that determines whether or >-not the body content should be processed. >+ Catches any Throwable that occurs in its body and optionally >+ exposes it. > </description> >- <name>test</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- <type>boolean</type> >- </attribute> >- <attribute> >+ <name>catch</name> >+ <tag-class>org.apache.taglibs.standard.tag.common.core.CatchTag</tag-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ Name of the exported scoped variable for the >+ exception thrown from a nested action. The type of the >+ scoped variable is the type of the exception thrown. >+ </description> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> >+ >+ <tag> > <description> >-Name of the exported scoped variable for the >-resulting value of the test condition. The type >-of the scoped variable is Boolean. >+ Simple conditional tag that establishes a context for >+ mutually exclusive conditional operations, marked by >+ <when> and <otherwise> > </description> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >+ <name>choose</name> >+ <tag-class>org.apache.taglibs.standard.tag.common.core.ChooseTag</tag-class> >+ <body-content>JSP</body-content> >+ </tag> >+ >+ <tag> > <description> >-Scope for var. >+ Simple conditional tag, which evalutes its body if the >+ supplied condition is true and optionally exposes a Boolean >+ scripting variable representing the evaluation of this condition > </description> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <name>if</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.core.IfTag</tag-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ The test condition that determines whether or >+ not the body content should be processed. >+ </description> >+ <name>test</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ <type>boolean</type> >+ </attribute> >+ <attribute> >+ <description> >+ Name of the exported scoped variable for the >+ resulting value of the test condition. The type >+ of the scoped variable is Boolean. >+ </description> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Scope for var. >+ </description> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- Retrieves an absolute or relative URL and exposes its contents >- to either the page, a String in 'var', or a Reader in 'varReader'. >- </description> >- <name>import</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.core.ImportTag</tag-class> >- <tei-class>org.apache.taglibs.standard.tei.ImportTEI</tei-class> >- <body-content>JSP</body-content> >- <attribute> >+ <tag> > <description> >-The URL of the resource to import. >+ Retrieves an absolute or relative URL and exposes its contents >+ to either the page, a String in 'var', or a Reader in 'varReader'. > </description> >- <name>url</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Name of the exported scoped variable for the >-resource's content. The type of the scoped >-variable is String. >- </description> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Scope for var. >- </description> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Name of the exported scoped variable for the >-resource's content. The type of the scoped >-variable is Reader. >- </description> >- <name>varReader</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Name of the context when accessing a relative >-URL resource that belongs to a foreign >-context. >- </description> >- <name>context</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Character encoding of the content at the input >-resource. >- </description> >- <name>charEncoding</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <name>import</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.core.ImportTag</tag-class> >+ <tei-class>org.apache.taglibs.standard.tei.ImportTEI</tei-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ The URL of the resource to import. >+ </description> >+ <name>url</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Name of the exported scoped variable for the >+ resource's content. The type of the scoped >+ variable is String. >+ </description> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Scope for var. >+ </description> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Name of the exported scoped variable for the >+ resource's content. The type of the scoped >+ variable is Reader. >+ </description> >+ <name>varReader</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Name of the context when accessing a relative >+ URL resource that belongs to a foreign >+ context. >+ </description> >+ <name>context</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Character encoding of the content at the input >+ resource. >+ </description> >+ <name>charEncoding</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- The basic iteration tag, accepting many different >- collection types and supporting subsetting and other >- functionality >- </description> >- <name>forEach</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.core.ForEachTag</tag-class> >- <tei-class>org.apache.taglibs.standard.tei.ForEachTEI</tei-class> >- <body-content>JSP</body-content> >- <attribute> >+ <tag> > <description> >-Collection of items to iterate over. >+ The basic iteration tag, accepting many different >+ collection types and supporting subsetting and other >+ functionality > </description> >- <name>items</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- <type>java.lang.Object</type> >- <deferred-value> >- <type>java.lang.Object</type> >- </deferred-value> >- </attribute> >- <attribute> >- <description> >-If items specified: >-Iteration begins at the item located at the >-specified index. First item of the collection has >-index 0. >-If items not specified: >-Iteration begins with index set at the value >-specified. >- </description> >- <name>begin</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- <type>int</type> >- </attribute> >- <attribute> >- <description> >-If items specified: >-Iteration ends at the item located at the >-specified index (inclusive). >-If items not specified: >-Iteration ends when index reaches the value >-specified. >- </description> >- <name>end</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- <type>int</type> >- </attribute> >- <attribute> >- <description> >-Iteration will only process every step items of >-the collection, starting with the first one. >- </description> >- <name>step</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- <type>int</type> >- </attribute> >- <attribute> >- <description> >-Name of the exported scoped variable for the >-current item of the iteration. This scoped >-variable has nested visibility. Its type depends >-on the object of the underlying collection. >- </description> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Name of the exported scoped variable for the >-status of the iteration. Object exported is of type >-javax.servlet.jsp.jstl.core.LoopTagStatus. This scoped variable has nested >-visibility. >- </description> >- <name>varStatus</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <name>forEach</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.core.ForEachTag</tag-class> >+ <tei-class>org.apache.taglibs.standard.tei.ForEachTEI</tei-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ Collection of items to iterate over. >+ </description> >+ <name>items</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ <type>java.lang.Object</type> >+ <deferred-value> >+ <type>java.lang.Object</type> >+ </deferred-value> >+ </attribute> >+ <attribute> >+ <description> >+ If items specified: >+ Iteration begins at the item located at the >+ specified index. First item of the collection has >+ index 0. >+ If items not specified: >+ Iteration begins with index set at the value >+ specified. >+ </description> >+ <name>begin</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ <type>int</type> >+ </attribute> >+ <attribute> >+ <description> >+ If items specified: >+ Iteration ends at the item located at the >+ specified index (inclusive). >+ If items not specified: >+ Iteration ends when index reaches the value >+ specified. >+ </description> >+ <name>end</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ <type>int</type> >+ </attribute> >+ <attribute> >+ <description> >+ Iteration will only process every step items of >+ the collection, starting with the first one. >+ </description> >+ <name>step</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ <type>int</type> >+ </attribute> >+ <attribute> >+ <description> >+ Name of the exported scoped variable for the >+ current item of the iteration. This scoped >+ variable has nested visibility. Its type depends >+ on the object of the underlying collection. >+ </description> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Name of the exported scoped variable for the >+ status of the iteration. Object exported is of type >+ javax.servlet.jsp.jstl.core.LoopTagStatus. This scoped variable has nested >+ visibility. >+ </description> >+ <name>varStatus</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- Iterates over tokens, separated by the supplied delimeters >- </description> >- <name>forTokens</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.core.ForTokensTag</tag-class> >- <body-content>JSP</body-content> >- <attribute> >+ <tag> > <description> >-String of tokens to iterate over. >+ Iterates over tokens, separated by the supplied delimeters > </description> >- <name>items</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- <type>java.lang.String</type> >- <deferred-value> >- <type>java.lang.String</type> >- </deferred-value> >- </attribute> >- <attribute> >- <description> >-The set of delimiters (the characters that >-separate the tokens in the string). >- </description> >- <name>delims</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- <type>java.lang.String</type> >- </attribute> >- <attribute> >- <description> >-Iteration begins at the token located at the >-specified index. First token has index 0. >- </description> >- <name>begin</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- <type>int</type> >- </attribute> >- <attribute> >- <description> >-Iteration ends at the token located at the >-specified index (inclusive). >- </description> >- <name>end</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- <type>int</type> >- </attribute> >- <attribute> >- <description> >-Iteration will only process every step tokens >-of the string, starting with the first one. >- </description> >- <name>step</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- <type>int</type> >- </attribute> >- <attribute> >- <description> >-Name of the exported scoped variable for the >-current item of the iteration. This scoped >-variable has nested visibility. >- </description> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Name of the exported scoped variable for the >-status of the iteration. Object exported is of >-type >-javax.servlet.jsp.jstl.core.LoopTag >-Status. This scoped variable has nested >-visibility. >- </description> >- <name>varStatus</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <name>forTokens</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.core.ForTokensTag</tag-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ String of tokens to iterate over. >+ </description> >+ <name>items</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ <type>java.lang.String</type> >+ <deferred-value> >+ <type>java.lang.String</type> >+ </deferred-value> >+ </attribute> >+ <attribute> >+ <description> >+ The set of delimiters (the characters that >+ separate the tokens in the string). >+ </description> >+ <name>delims</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ <type>java.lang.String</type> >+ </attribute> >+ <attribute> >+ <description> >+ Iteration begins at the token located at the >+ specified index. First token has index 0. >+ </description> >+ <name>begin</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ <type>int</type> >+ </attribute> >+ <attribute> >+ <description> >+ Iteration ends at the token located at the >+ specified index (inclusive). >+ </description> >+ <name>end</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ <type>int</type> >+ </attribute> >+ <attribute> >+ <description> >+ Iteration will only process every step tokens >+ of the string, starting with the first one. >+ </description> >+ <name>step</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ <type>int</type> >+ </attribute> >+ <attribute> >+ <description> >+ Name of the exported scoped variable for the >+ current item of the iteration. This scoped >+ variable has nested visibility. >+ </description> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Name of the exported scoped variable for the >+ status of the iteration. Object exported is of >+ type >+ javax.servlet.jsp.jstl.core.LoopTag >+ Status. This scoped variable has nested >+ visibility. >+ </description> >+ <name>varStatus</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- Like <%= ... >, but for expressions. >- </description> >- <name>out</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.core.OutTag</tag-class> >- <body-content>JSP</body-content> >- <attribute> >+ <tag> > <description> >-Expression to be evaluated. >+ Like <%= ... >, but for expressions. > </description> >- <name>value</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Default value if the resulting value is null. >- </description> >- <name>default</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Determines whether characters <,>,&,'," in the >-resulting string should be converted to their >-corresponding character entity codes. Default value is >-true. >- </description> >- <name>escapeXml</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <name>out</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.core.OutTag</tag-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ Expression to be evaluated. >+ </description> >+ <name>value</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Default value if the resulting value is null. >+ </description> >+ <name>default</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Determines whether characters <,>,&,'," in the >+ resulting string should be converted to their >+ corresponding character entity codes. Default value is >+ true. >+ </description> >+ <name>escapeXml</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > > >- <tag> >- <description> >- Subtag of <choose> that follows <when> tags >- and runs only if all of the prior conditions evaluated to >- 'false' >- </description> >- <name>otherwise</name> >- <tag-class>org.apache.taglibs.standard.tag.common.core.OtherwiseTag</tag-class> >- <body-content>JSP</body-content> >- </tag> >- >- <tag> >- <description> >- Adds a parameter to a containing 'import' tag's URL. >- </description> >- <name>param</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.core.ParamTag</tag-class> >- <body-content>JSP</body-content> >- <attribute> >+ <tag> > <description> >-Name of the query string parameter. >+ Subtag of <choose> that follows <when> tags >+ and runs only if all of the prior conditions evaluated to >+ 'false' > </description> >- <name>name</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >+ <name>otherwise</name> >+ <tag-class>org.apache.taglibs.standard.tag.common.core.OtherwiseTag</tag-class> >+ <body-content>JSP</body-content> >+ </tag> >+ >+ <tag> > <description> >-Value of the parameter. >+ Adds a parameter to a containing 'import' tag's URL. > </description> >- <name>value</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <name>param</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.core.ParamTag</tag-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ Name of the query string parameter. >+ </description> >+ <name>name</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Value of the parameter. >+ </description> >+ <name>value</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- Redirects to a new URL. >- </description> >- <name>redirect</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.core.RedirectTag</tag-class> >- <body-content>JSP</body-content> >- <attribute> >+ <tag> > <description> >-The URL of the resource to redirect to. >+ Redirects to a new URL. > </description> >- <name>url</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Name of the context when redirecting to a relative URL >-resource that belongs to a foreign context. >- </description> >- <name>context</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <name>redirect</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.core.RedirectTag</tag-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ The URL of the resource to redirect to. >+ </description> >+ <name>url</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Name of the context when redirecting to a relative URL >+ resource that belongs to a foreign context. >+ </description> >+ <name>context</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- Removes a scoped variable (from a particular scope, if specified). >- </description> >- <name>remove</name> >- <tag-class>org.apache.taglibs.standard.tag.common.core.RemoveTag</tag-class> >- <body-content>empty</body-content> >- <attribute> >+ <tag> > <description> >-Name of the scoped variable to be removed. >+ Removes a scoped variable (from a particular scope, if specified). > </description> >- <name>var</name> >- <required>true</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Scope for var. >- </description> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <name>remove</name> >+ <tag-class>org.apache.taglibs.standard.tag.common.core.RemoveTag</tag-class> >+ <body-content>empty</body-content> >+ <attribute> >+ <description> >+ Name of the scoped variable to be removed. >+ </description> >+ <name>var</name> >+ <required>true</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Scope for var. >+ </description> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- Sets the result of an expression evaluation in a 'scope' >- </description> >- <name>set</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.core.SetTag</tag-class> >- <body-content>JSP</body-content> >- <attribute> >+ <tag> > <description> >-Name of the exported scoped variable to hold the value >-specified in the action. The type of the scoped variable is >-whatever type the value expression evaluates to. >+ Sets the result of an expression evaluation in a 'scope' > </description> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Expression to be evaluated. >- </description> >- <name>value</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- <deferred-value> >- <type>java.lang.Object</type> >- </deferred-value> >- </attribute> >- <attribute> >- <description> >-Target object whose property will be set. Must evaluate to >-a JavaBeans object with setter property property, or to a >-java.util.Map object. >- </description> >- <name>target</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Name of the property to be set in the target object. >- </description> >- <name>property</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Scope for var. >- </description> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <name>set</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.core.SetTag</tag-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ Name of the exported scoped variable to hold the value >+ specified in the action. The type of the scoped variable is >+ whatever type the value expression evaluates to. >+ </description> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Expression to be evaluated. >+ </description> >+ <name>value</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ <deferred-value> >+ <type>java.lang.Object</type> >+ </deferred-value> >+ </attribute> >+ <attribute> >+ <description> >+ Target object whose property will be set. Must evaluate to >+ a JavaBeans object with setter property property, or to a >+ java.util.Map object. >+ </description> >+ <name>target</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Name of the property to be set in the target object. >+ </description> >+ <name>property</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Scope for var. >+ </description> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- Creates a URL with optional query parameters. >- </description> >- <name>url</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.core.UrlTag</tag-class> >- <body-content>JSP</body-content> >- <attribute> >+ <tag> > <description> >-Name of the exported scoped variable for the >-processed url. The type of the scoped variable is >-String. >+ Creates a URL with optional query parameters. > </description> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Scope for var. >- </description> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-URL to be processed. >- </description> >- <name>value</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Name of the context when specifying a relative URL >-resource that belongs to a foreign context. >- </description> >- <name>context</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <name>url</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.core.UrlTag</tag-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ Name of the exported scoped variable for the >+ processed url. The type of the scoped variable is >+ String. >+ </description> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Scope for var. >+ </description> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ URL to be processed. >+ </description> >+ <name>value</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Name of the context when specifying a relative URL >+ resource that belongs to a foreign context. >+ </description> >+ <name>context</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- Subtag of <choose> that includes its body if its >- condition evalutes to 'true' >- </description> >- <name>when</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.core.WhenTag</tag-class> >- <body-content>JSP</body-content> >- <attribute> >+ <tag> > <description> >-The test condition that determines whether or not the >-body content should be processed. >+ Subtag of <choose> that includes its body if its >+ condition evalutes to 'true' > </description> >- <name>test</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- <type>boolean</type> >- </attribute> >- </tag> >+ <name>when</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.core.WhenTag</tag-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ The test condition that determines whether or not the >+ body content should be processed. >+ </description> >+ <name>test</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ <type>boolean</type> >+ </attribute> >+ </tag> > > </taglib> >Index: src/main/resources/META-INF/fn.tld >=================================================================== >--- src/main/resources/META-INF/fn.tld (revision 1034807) >+++ src/main/resources/META-INF/fn.tld (working copy) >@@ -1,207 +1,208 @@ > <?xml version="1.0" encoding="UTF-8" ?> > > <taglib xmlns="http://java.sun.com/xml/ns/j2ee" >- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" >- version="2.0"> >- >- <description>JSTL 1.1 functions library</description> >- <display-name>JSTL functions</display-name> >- <tlib-version>1.1</tlib-version> >- <short-name>fn</short-name> >- <uri>http://java.sun.com/jsp/jstl/functions</uri> >+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" >+ version="2.0"> > >- <function> >- <description> >- Tests if an input string contains the specified substring. >- </description> >- <name>contains</name> >- <function-class>org.apache.taglibs.standard.functions.Functions</function-class> >- <function-signature>boolean contains(java.lang.String, java.lang.String)</function-signature> >- <example> >- <c:if test="${fn:contains(name, searchString)}"> >- </example> >- </function> >+ <description>JSTL 1.1 functions library</description> >+ <display-name>JSTL functions</display-name> >+ <tlib-version>1.1</tlib-version> >+ <short-name>fn</short-name> >+ <uri>http://java.sun.com/jsp/jstl/functions</uri> > >- <function> >- <description> >- Tests if an input string contains the specified substring in a case insensitive way. >- </description> >- <name>containsIgnoreCase</name> >- <function-class>org.apache.taglibs.standard.functions.Functions</function-class> >- <function-signature>boolean containsIgnoreCase(java.lang.String, java.lang.String)</function-signature> >- <example> >- <c:if test="${fn:containsIgnoreCase(name, searchString)}"> >- </example> >- </function> >+ <function> >+ <description> >+ Tests if an input string contains the specified substring. >+ </description> >+ <name>contains</name> >+ <function-class>org.apache.taglibs.standard.functions.Functions</function-class> >+ <function-signature>boolean contains(java.lang.String, java.lang.String)</function-signature> >+ <example> >+ <c:if test="${fn:contains(name, searchString)}"> >+ </example> >+ </function> > >- <function> >- <description> >- Tests if an input string ends with the specified suffix. >- </description> >- <name>endsWith</name> >- <function-class>org.apache.taglibs.standard.functions.Functions</function-class> >- <function-signature>boolean endsWith(java.lang.String, java.lang.String)</function-signature> >- <example> >- <c:if test="${fn:endsWith(filename, ".txt")}"> >- </example> >- </function> >+ <function> >+ <description> >+ Tests if an input string contains the specified substring in a case insensitive way. >+ </description> >+ <name>containsIgnoreCase</name> >+ <function-class>org.apache.taglibs.standard.functions.Functions</function-class> >+ <function-signature>boolean containsIgnoreCase(java.lang.String, java.lang.String)</function-signature> >+ <example> >+ <c:if test="${fn:containsIgnoreCase(name, searchString)}"> >+ </example> >+ </function> > >- <function> >- <description> >- Escapes characters that could be interpreted as XML markup. >- </description> >- <name>escapeXml</name> >- <function-class>org.apache.taglibs.standard.functions.Functions</function-class> >- <function-signature>java.lang.String escapeXml(java.lang.String)</function-signature> >- <example> >- ${fn:escapeXml(param:info)} >- </example> >- </function> >+ <function> >+ <description> >+ Tests if an input string ends with the specified suffix. >+ </description> >+ <name>endsWith</name> >+ <function-class>org.apache.taglibs.standard.functions.Functions</function-class> >+ <function-signature>boolean endsWith(java.lang.String, java.lang.String)</function-signature> >+ <example> >+ <c:if test="${fn:endsWith(filename, ".txt")}"> >+ </example> >+ </function> > >- <function> >- <description> >- Returns the index withing a string of the first occurrence of a specified substring. >- </description> >- <name>indexOf</name> >- <function-class>org.apache.taglibs.standard.functions.Functions</function-class> >- <function-signature>int indexOf(java.lang.String, java.lang.String)</function-signature> >- <example> >- ${fn:indexOf(name, "-")} >- </example> >- </function> >+ <function> >+ <description> >+ Escapes characters that could be interpreted as XML markup. >+ </description> >+ <name>escapeXml</name> >+ <function-class>org.apache.taglibs.standard.functions.Functions</function-class> >+ <function-signature>java.lang.String escapeXml(java.lang.String)</function-signature> >+ <example> >+ ${fn:escapeXml(param:info)} >+ </example> >+ </function> > >- <function> >- <description> >- Joins all elements of an array into a string. >- </description> >- <name>join</name> >- <function-class>org.apache.taglibs.standard.functions.Functions</function-class> >- <function-signature>java.lang.String join(java.lang.String[], java.lang.String)</function-signature> >- <example> >- ${fn:join(array, ";")} >- </example> >- </function> >+ <function> >+ <description> >+ Returns the index withing a string of the first occurrence of a specified substring. >+ </description> >+ <name>indexOf</name> >+ <function-class>org.apache.taglibs.standard.functions.Functions</function-class> >+ <function-signature>int indexOf(java.lang.String, java.lang.String)</function-signature> >+ <example> >+ ${fn:indexOf(name, "-")} >+ </example> >+ </function> > >- <function> >- <description> >- Returns the number of items in a collection, or the number of characters in a string. >- </description> >- <name>length</name> >- <function-class>org.apache.taglibs.standard.functions.Functions</function-class> >- <function-signature>int length(java.lang.Object)</function-signature> >- <example> >- You have ${fn:length(shoppingCart.products)} in your shopping cart. >- </example> >- </function> >+ <function> >+ <description> >+ Joins all elements of an array into a string. >+ </description> >+ <name>join</name> >+ <function-class>org.apache.taglibs.standard.functions.Functions</function-class> >+ <function-signature>java.lang.String join(java.lang.String[], java.lang.String)</function-signature> >+ <example> >+ ${fn:join(array, ";")} >+ </example> >+ </function> > >- <function> >- <description> >- Returns a string resulting from replacing in an input string all occurrences >- of a "before" string into an "after" substring. >- </description> >- <name>replace</name> >- <function-class>org.apache.taglibs.standard.functions.Functions</function-class> >- <function-signature>java.lang.String replace(java.lang.String, java.lang.String, java.lang.String)</function-signature> >- <example> >- ${fn:replace(text, "-", "•")} >- </example> >- </function> >+ <function> >+ <description> >+ Returns the number of items in a collection, or the number of characters in a string. >+ </description> >+ <name>length</name> >+ <function-class>org.apache.taglibs.standard.functions.Functions</function-class> >+ <function-signature>int length(java.lang.Object)</function-signature> >+ <example> >+ You have ${fn:length(shoppingCart.products)} in your shopping cart. >+ </example> >+ </function> > >- <function> >- <description> >- Splits a string into an array of substrings. >- </description> >- <name>split</name> >- <function-class>org.apache.taglibs.standard.functions.Functions</function-class> >- <function-signature>java.lang.String[] split(java.lang.String, java.lang.String)</function-signature> >- <example> >- ${fn:split(customerNames, ";")} >- </example> >- </function> >+ <function> >+ <description> >+ Returns a string resulting from replacing in an input string all occurrences >+ of a "before" string into an "after" substring. >+ </description> >+ <name>replace</name> >+ <function-class>org.apache.taglibs.standard.functions.Functions</function-class> >+ <function-signature>java.lang.String replace(java.lang.String, java.lang.String, java.lang.String) >+ </function-signature> >+ <example> >+ ${fn:replace(text, "-", "•")} >+ </example> >+ </function> > >- <function> >- <description> >- Tests if an input string starts with the specified prefix. >- </description> >- <name>startsWith</name> >- <function-class>org.apache.taglibs.standard.functions.Functions</function-class> >- <function-signature>boolean startsWith(java.lang.String, java.lang.String)</function-signature> >- <example> >- <c:if test="${fn:startsWith(product.id, "100-")}"> >- </example> >- </function> >+ <function> >+ <description> >+ Splits a string into an array of substrings. >+ </description> >+ <name>split</name> >+ <function-class>org.apache.taglibs.standard.functions.Functions</function-class> >+ <function-signature>java.lang.String[] split(java.lang.String, java.lang.String)</function-signature> >+ <example> >+ ${fn:split(customerNames, ";")} >+ </example> >+ </function> > >- <function> >- <description> >- Returns a subset of a string. >- </description> >- <name>substring</name> >- <function-class>org.apache.taglibs.standard.functions.Functions</function-class> >- <function-signature>java.lang.String substring(java.lang.String, int, int)</function-signature> >- <example> >- P.O. Box: ${fn:substring(zip, 6, -1)} >- </example> >- </function> >+ <function> >+ <description> >+ Tests if an input string starts with the specified prefix. >+ </description> >+ <name>startsWith</name> >+ <function-class>org.apache.taglibs.standard.functions.Functions</function-class> >+ <function-signature>boolean startsWith(java.lang.String, java.lang.String)</function-signature> >+ <example> >+ <c:if test="${fn:startsWith(product.id, "100-")}"> >+ </example> >+ </function> > >- <function> >- <description> >- Returns a subset of a string following a specific substring. >- </description> >- <name>substringAfter</name> >- <function-class>org.apache.taglibs.standard.functions.Functions</function-class> >- <function-signature>java.lang.String substringAfter(java.lang.String, java.lang.String)</function-signature> >- <example> >- P.O. Box: ${fn:substringAfter(zip, "-")} >- </example> >- </function> >+ <function> >+ <description> >+ Returns a subset of a string. >+ </description> >+ <name>substring</name> >+ <function-class>org.apache.taglibs.standard.functions.Functions</function-class> >+ <function-signature>java.lang.String substring(java.lang.String, int, int)</function-signature> >+ <example> >+ P.O. Box: ${fn:substring(zip, 6, -1)} >+ </example> >+ </function> > >- <function> >- <description> >- Returns a subset of a string before a specific substring. >- </description> >- <name>substringBefore</name> >- <function-class>org.apache.taglibs.standard.functions.Functions</function-class> >- <function-signature>java.lang.String substringBefore(java.lang.String, java.lang.String)</function-signature> >- <example> >- Zip (without P.O. Box): ${fn:substringBefore(zip, "-")} >- </example> >- </function> >+ <function> >+ <description> >+ Returns a subset of a string following a specific substring. >+ </description> >+ <name>substringAfter</name> >+ <function-class>org.apache.taglibs.standard.functions.Functions</function-class> >+ <function-signature>java.lang.String substringAfter(java.lang.String, java.lang.String)</function-signature> >+ <example> >+ P.O. Box: ${fn:substringAfter(zip, "-")} >+ </example> >+ </function> > >- <function> >- <description> >- Converts all of the characters of a string to lower case. >- </description> >- <name>toLowerCase</name> >- <function-class>org.apache.taglibs.standard.functions.Functions</function-class> >- <function-signature>java.lang.String toLowerCase(java.lang.String)</function-signature> >- <example> >- Product name: ${fn.toLowerCase(product.name)} >- </example> >- </function> >+ <function> >+ <description> >+ Returns a subset of a string before a specific substring. >+ </description> >+ <name>substringBefore</name> >+ <function-class>org.apache.taglibs.standard.functions.Functions</function-class> >+ <function-signature>java.lang.String substringBefore(java.lang.String, java.lang.String)</function-signature> >+ <example> >+ Zip (without P.O. Box): ${fn:substringBefore(zip, "-")} >+ </example> >+ </function> > >- <function> >- <description> >- Converts all of the characters of a string to upper case. >- </description> >- <name>toUpperCase</name> >- <function-class>org.apache.taglibs.standard.functions.Functions</function-class> >- <function-signature>java.lang.String toUpperCase(java.lang.String)</function-signature> >- <example> >- Product name: ${fn.UpperCase(product.name)} >- </example> >- </function> >+ <function> >+ <description> >+ Converts all of the characters of a string to lower case. >+ </description> >+ <name>toLowerCase</name> >+ <function-class>org.apache.taglibs.standard.functions.Functions</function-class> >+ <function-signature>java.lang.String toLowerCase(java.lang.String)</function-signature> >+ <example> >+ Product name: ${fn.toLowerCase(product.name)} >+ </example> >+ </function> > >- <function> >- <description> >- Removes white spaces from both ends of a string. >- </description> >- <name>trim</name> >- <function-class>org.apache.taglibs.standard.functions.Functions</function-class> >- <function-signature>java.lang.String trim(java.lang.String)</function-signature> >- <example> >- Name: ${fn.trim(name)} >- </example> >- </function> >+ <function> >+ <description> >+ Converts all of the characters of a string to upper case. >+ </description> >+ <name>toUpperCase</name> >+ <function-class>org.apache.taglibs.standard.functions.Functions</function-class> >+ <function-signature>java.lang.String toUpperCase(java.lang.String)</function-signature> >+ <example> >+ Product name: ${fn.UpperCase(product.name)} >+ </example> >+ </function> > >+ <function> >+ <description> >+ Removes white spaces from both ends of a string. >+ </description> >+ <name>trim</name> >+ <function-class>org.apache.taglibs.standard.functions.Functions</function-class> >+ <function-signature>java.lang.String trim(java.lang.String)</function-signature> >+ <example> >+ Name: ${fn.trim(name)} >+ </example> >+ </function> >+ > </taglib> >Index: src/main/resources/META-INF/permittedTaglibs.tld >=================================================================== >--- src/main/resources/META-INF/permittedTaglibs.tld (revision 1034807) >+++ src/main/resources/META-INF/permittedTaglibs.tld (working copy) >@@ -1,34 +1,34 @@ > <?xml version="1.0" encoding="UTF-8" ?> > > <taglib xmlns="http://java.sun.com/xml/ns/j2ee" >- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" >- version="2.0"> >- <description> >- Restricts JSP pages to the JSTL tag libraries >- </description> >- <display-name>permittedTaglibs</display-name> >- <tlib-version>1.1</tlib-version> >- <short-name>permittedTaglibs</short-name> >- <uri>http://jakarta.apache.org/taglibs/standard/permittedTaglibs</uri> >+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" >+ version="2.0"> >+ <description> >+ Restricts JSP pages to the JSTL tag libraries >+ </description> >+ <display-name>permittedTaglibs</display-name> >+ <tlib-version>1.1</tlib-version> >+ <short-name>permittedTaglibs</short-name> >+ <uri>http://jakarta.apache.org/taglibs/standard/permittedTaglibs</uri> > >- <validator> >- <validator-class> >- javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV >- </validator-class> >- <init-param> >- <description> >- Whitespace-separated list of taglib URIs to permit. This example >- TLD for the Standard Taglib allows only JSTL 'el' taglibs to be >- imported. >- </description> >- <param-name>permittedTaglibs</param-name> >- <param-value> >- http://java.sun.com/jsp/jstl/core >- http://java.sun.com/jsp/jstl/fmt >- http://java.sun.com/jsp/jstl/sql >- http://java.sun.com/jsp/jstl/xml >- </param-value> >- </init-param> >- </validator> >+ <validator> >+ <validator-class> >+ javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV >+ </validator-class> >+ <init-param> >+ <description> >+ Whitespace-separated list of taglib URIs to permit. This example >+ TLD for the Standard Taglib allows only JSTL 'el' taglibs to be >+ imported. >+ </description> >+ <param-name>permittedTaglibs</param-name> >+ <param-value> >+ http://java.sun.com/jsp/jstl/core >+ http://java.sun.com/jsp/jstl/fmt >+ http://java.sun.com/jsp/jstl/sql >+ http://java.sun.com/jsp/jstl/xml >+ </param-value> >+ </init-param> >+ </validator> > </taglib> >Index: src/main/resources/META-INF/scriptfree.tld >=================================================================== >--- src/main/resources/META-INF/scriptfree.tld (revision 1034807) >+++ src/main/resources/META-INF/scriptfree.tld (working copy) >@@ -1,51 +1,51 @@ > <?xml version="1.0" encoding="UTF-8" ?> > > <taglib xmlns="http://java.sun.com/xml/ns/j2ee" >- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" >- version="2.0"> >- <description> >- Validates JSP pages to prohibit use of scripting elements. >- </description> >- <tlib-version>1.1</tlib-version> >- <short-name>scriptfree</short-name> >- <uri>http://jakarta.apache.org/taglibs/standard/scriptfree</uri> >- >- <validator> >+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" >+ version="2.0"> > <description> >- Validates prohibitions against scripting elements. >+ Validates JSP pages to prohibit use of scripting elements. > </description> >- <validator-class> >- javax.servlet.jsp.jstl.tlv.ScriptFreeTLV >- </validator-class> >- <init-param> >- <description> >- Controls whether or not declarations are considered valid. >- </description> >- <param-name>allowDeclarations</param-name> >- <param-value>false</param-value> >- </init-param> >- <init-param> >- <description> >- Controls whether or not scriptlets are considered valid. >- </description> >- <param-name>allowScriptlets</param-name> >- <param-value>false</param-value> >- </init-param> >- <init-param> >- <description> >- Controls whether or not top-level expressions are considered valid. >- </description> >- <param-name>allowExpressions</param-name> >- <param-value>false</param-value> >- </init-param> >- <init-param> >- <description> >- Controls whether or not expressions used to supply request-time >- attribute values are considered valid. >- </description> >- <param-name>allowRTExpressions</param-name> >- <param-value>false</param-value> >- </init-param> >- </validator> >+ <tlib-version>1.1</tlib-version> >+ <short-name>scriptfree</short-name> >+ <uri>http://jakarta.apache.org/taglibs/standard/scriptfree</uri> >+ >+ <validator> >+ <description> >+ Validates prohibitions against scripting elements. >+ </description> >+ <validator-class> >+ javax.servlet.jsp.jstl.tlv.ScriptFreeTLV >+ </validator-class> >+ <init-param> >+ <description> >+ Controls whether or not declarations are considered valid. >+ </description> >+ <param-name>allowDeclarations</param-name> >+ <param-value>false</param-value> >+ </init-param> >+ <init-param> >+ <description> >+ Controls whether or not scriptlets are considered valid. >+ </description> >+ <param-name>allowScriptlets</param-name> >+ <param-value>false</param-value> >+ </init-param> >+ <init-param> >+ <description> >+ Controls whether or not top-level expressions are considered valid. >+ </description> >+ <param-name>allowExpressions</param-name> >+ <param-value>false</param-value> >+ </init-param> >+ <init-param> >+ <description> >+ Controls whether or not expressions used to supply request-time >+ attribute values are considered valid. >+ </description> >+ <param-name>allowRTExpressions</param-name> >+ <param-value>false</param-value> >+ </init-param> >+ </validator> > </taglib> >Index: src/main/resources/META-INF/fmt.tld >=================================================================== >--- src/main/resources/META-INF/fmt.tld (revision 1034807) >+++ src/main/resources/META-INF/fmt.tld (working copy) >@@ -1,671 +1,671 @@ > <?xml version="1.0" encoding="UTF-8" ?> > > <taglib xmlns="http://java.sun.com/xml/ns/j2ee" >- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" >- version="2.0"> >- >- <description>JSTL 1.1 i18n-capable formatting library</description> >- <display-name>JSTL fmt</display-name> >- <tlib-version>1.1</tlib-version> >- <short-name>fmt</short-name> >- <uri>http://java.sun.com/jsp/jstl/fmt</uri> >+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" >+ version="2.0"> > >- <validator> >- <description> >- Provides core validation features for JSTL tags. >- </description> >- <validator-class> >- org.apache.taglibs.standard.tlv.JstlFmtTLV >- </validator-class> >- </validator> >+ <description>JSTL 1.1 i18n-capable formatting library</description> >+ <display-name>JSTL fmt</display-name> >+ <tlib-version>1.1</tlib-version> >+ <short-name>fmt</short-name> >+ <uri>http://java.sun.com/jsp/jstl/fmt</uri> > >- <tag> >- <description> >- Sets the request character encoding >- </description> >- <name>requestEncoding</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.fmt.RequestEncodingTag</tag-class> >- <body-content>empty</body-content> >- <attribute> >+ <validator> > <description> >-Name of character encoding to be applied when >-decoding request parameters. >+ Provides core validation features for JSTL tags. > </description> >- <name>value</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <validator-class> >+ org.apache.taglibs.standard.tlv.JstlFmtTLV >+ </validator-class> >+ </validator> > >- <tag> >- <description> >- Stores the given locale in the locale configuration variable >- </description> >- <name>setLocale</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.fmt.SetLocaleTag</tag-class> >- <body-content>empty</body-content> >- <attribute> >+ <tag> > <description> >-A String value is interpreted as the >-printable representation of a locale, which >-must contain a two-letter (lower-case) >-language code (as defined by ISO-639), >-and may contain a two-letter (upper-case) >-country code (as defined by ISO-3166). >-Language and country codes must be >-separated by hyphen (-) or underscore >-(_). >- </description> >- <name>value</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Vendor- or browser-specific variant. >-See the java.util.Locale javadocs for >-more information on variants. >+ Sets the request character encoding > </description> >- <name>variant</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >+ <name>requestEncoding</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.fmt.RequestEncodingTag</tag-class> >+ <body-content>empty</body-content> >+ <attribute> >+ <description> >+ Name of character encoding to be applied when >+ decoding request parameters. >+ </description> >+ <name>value</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> >+ >+ <tag> > <description> >-Scope of the locale configuration variable. >+ Stores the given locale in the locale configuration variable > </description> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <name>setLocale</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.fmt.SetLocaleTag</tag-class> >+ <body-content>empty</body-content> >+ <attribute> >+ <description> >+ A String value is interpreted as the >+ printable representation of a locale, which >+ must contain a two-letter (lower-case) >+ language code (as defined by ISO-639), >+ and may contain a two-letter (upper-case) >+ country code (as defined by ISO-3166). >+ Language and country codes must be >+ separated by hyphen (-) or underscore >+ (_). >+ </description> >+ <name>value</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Vendor- or browser-specific variant. >+ See the java.util.Locale javadocs for >+ more information on variants. >+ </description> >+ <name>variant</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Scope of the locale configuration variable. >+ </description> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- Specifies the time zone for any time formatting or parsing actions >- nested in its body >- </description> >- <name>timeZone</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.fmt.TimeZoneTag</tag-class> >- <body-content>JSP</body-content> >- <attribute> >+ <tag> > <description> >-The time zone. A String value is interpreted as >-a time zone ID. This may be one of the time zone >-IDs supported by the Java platform (such as >-"America/Los_Angeles") or a custom time zone >-ID (such as "GMT-8"). See >-java.util.TimeZone for more information on >-supported time zone formats. >+ Specifies the time zone for any time formatting or parsing actions >+ nested in its body > </description> >- <name>value</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <name>timeZone</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.fmt.TimeZoneTag</tag-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ The time zone. A String value is interpreted as >+ a time zone ID. This may be one of the time zone >+ IDs supported by the Java platform (such as >+ "America/Los_Angeles") or a custom time zone >+ ID (such as "GMT-8"). See >+ java.util.TimeZone for more information on >+ supported time zone formats. >+ </description> >+ <name>value</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- Stores the given time zone in the time zone configuration variable >- </description> >- <name>setTimeZone</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.fmt.SetTimeZoneTag</tag-class> >- <body-content>empty</body-content> >- <attribute> >+ <tag> > <description> >-The time zone. A String value is interpreted as >-a time zone ID. This may be one of the time zone >-IDs supported by the Java platform (such as >-"America/Los_Angeles") or a custom time zone >-ID (such as "GMT-8"). See java.util.TimeZone for >-more information on supported time zone >-formats. >+ Stores the given time zone in the time zone configuration variable > </description> >- <name>value</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Name of the exported scoped variable which >-stores the time zone of type >-java.util.TimeZone. >- </description> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Scope of var or the time zone configuration >-variable. >- </description> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <name>setTimeZone</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.fmt.SetTimeZoneTag</tag-class> >+ <body-content>empty</body-content> >+ <attribute> >+ <description> >+ The time zone. A String value is interpreted as >+ a time zone ID. This may be one of the time zone >+ IDs supported by the Java platform (such as >+ "America/Los_Angeles") or a custom time zone >+ ID (such as "GMT-8"). See java.util.TimeZone for >+ more information on supported time zone >+ formats. >+ </description> >+ <name>value</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Name of the exported scoped variable which >+ stores the time zone of type >+ java.util.TimeZone. >+ </description> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Scope of var or the time zone configuration >+ variable. >+ </description> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- Loads a resource bundle to be used by its tag body >- </description> >- <name>bundle</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.fmt.BundleTag</tag-class> >- <body-content>JSP</body-content> >- <attribute> >+ <tag> > <description> >-Resource bundle base name. This is the bundle's >-fully-qualified resource name, which has the same >-form as a fully-qualified class name, that is, it uses >-"." as the package component separator and does not >-have any file type (such as ".class" or ".properties") >-suffix. >+ Loads a resource bundle to be used by its tag body > </description> >- <name>basename</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Prefix to be prepended to the value of the message >-key of any nested <fmt:message> action. >- </description> >- <name>prefix</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <name>bundle</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.fmt.BundleTag</tag-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ Resource bundle base name. This is the bundle's >+ fully-qualified resource name, which has the same >+ form as a fully-qualified class name, that is, it uses >+ "." as the package component separator and does not >+ have any file type (such as ".class" or ".properties") >+ suffix. >+ </description> >+ <name>basename</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Prefix to be prepended to the value of the message >+ key of any nested <fmt:message> action. >+ </description> >+ <name>prefix</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- Loads a resource bundle and stores it in the named scoped variable or >- the bundle configuration variable >- </description> >- <name>setBundle</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.fmt.SetBundleTag</tag-class> >- <body-content>empty</body-content> >- <attribute> >+ <tag> > <description> >-Resource bundle base name. This is the bundle's >-fully-qualified resource name, which has the same >-form as a fully-qualified class name, that is, it uses >-"." as the package component separator and does not >-have any file type (such as ".class" or ".properties") >-suffix. >+ Loads a resource bundle and stores it in the named scoped variable or >+ the bundle configuration variable > </description> >- <name>basename</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Name of the exported scoped variable which stores >-the i18n localization context of type >-javax.servlet.jsp.jstl.fmt.LocalizationC >-ontext. >- </description> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Scope of var or the localization context >-configuration variable. >- </description> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <name>setBundle</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.fmt.SetBundleTag</tag-class> >+ <body-content>empty</body-content> >+ <attribute> >+ <description> >+ Resource bundle base name. This is the bundle's >+ fully-qualified resource name, which has the same >+ form as a fully-qualified class name, that is, it uses >+ "." as the package component separator and does not >+ have any file type (such as ".class" or ".properties") >+ suffix. >+ </description> >+ <name>basename</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Name of the exported scoped variable which stores >+ the i18n localization context of type >+ javax.servlet.jsp.jstl.fmt.LocalizationC >+ ontext. >+ </description> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Scope of var or the localization context >+ configuration variable. >+ </description> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- Maps key to localized message and performs parametric replacement >- </description> >- <name>message</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.fmt.MessageTag</tag-class> >- <body-content>JSP</body-content> >- <attribute> >+ <tag> > <description> >-Message key to be looked up. >+ Maps key to localized message and performs parametric replacement > </description> >- <name>key</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Localization context in whose resource >-bundle the message key is looked up. >- </description> >- <name>bundle</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Name of the exported scoped variable >-which stores the localized message. >- </description> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Scope of var. >- </description> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <name>message</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.fmt.MessageTag</tag-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ Message key to be looked up. >+ </description> >+ <name>key</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Localization context in whose resource >+ bundle the message key is looked up. >+ </description> >+ <name>bundle</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Name of the exported scoped variable >+ which stores the localized message. >+ </description> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Scope of var. >+ </description> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- Supplies an argument for parametric replacement to a containing >- <message> tag >- </description> >- <name>param</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.fmt.ParamTag</tag-class> >- <body-content>JSP</body-content> >- <attribute> >+ <tag> > <description> >-Argument used for parametric replacement. >+ Supplies an argument for parametric replacement to a containing >+ <message> tag > </description> >- <name>value</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <name>param</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.fmt.ParamTag</tag-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ Argument used for parametric replacement. >+ </description> >+ <name>value</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- Formats a numeric value as a number, currency, or percentage >- </description> >- <name>formatNumber</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.fmt.FormatNumberTag</tag-class> >- <body-content>JSP</body-content> >- <attribute> >+ <tag> > <description> >-Numeric value to be formatted. >+ Formats a numeric value as a number, currency, or percentage > </description> >- <name>value</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Specifies whether the value is to be >-formatted as number, currency, or >-percentage. >- </description> >- <name>type</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Custom formatting pattern. >- </description> >- <name>pattern</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-ISO 4217 currency code. Applied only >-when formatting currencies (i.e. if type is >-equal to "currency"); ignored otherwise. >- </description> >- <name>currencyCode</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Currency symbol. Applied only when >-formatting currencies (i.e. if type is equal >-to "currency"); ignored otherwise. >- </description> >- <name>currencySymbol</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Specifies whether the formatted output >-will contain any grouping separators. >- </description> >- <name>groupingUsed</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Maximum number of digits in the integer >-portion of the formatted output. >- </description> >- <name>maxIntegerDigits</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Minimum number of digits in the integer >-portion of the formatted output. >- </description> >- <name>minIntegerDigits</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Maximum number of digits in the >-fractional portion of the formatted output. >- </description> >- <name>maxFractionDigits</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Minimum number of digits in the >-fractional portion of the formatted output. >- </description> >- <name>minFractionDigits</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Name of the exported scoped variable >-which stores the formatted result as a >-String. >- </description> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Scope of var. >- </description> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <name>formatNumber</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.fmt.FormatNumberTag</tag-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ Numeric value to be formatted. >+ </description> >+ <name>value</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Specifies whether the value is to be >+ formatted as number, currency, or >+ percentage. >+ </description> >+ <name>type</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Custom formatting pattern. >+ </description> >+ <name>pattern</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ ISO 4217 currency code. Applied only >+ when formatting currencies (i.e. if type is >+ equal to "currency"); ignored otherwise. >+ </description> >+ <name>currencyCode</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Currency symbol. Applied only when >+ formatting currencies (i.e. if type is equal >+ to "currency"); ignored otherwise. >+ </description> >+ <name>currencySymbol</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Specifies whether the formatted output >+ will contain any grouping separators. >+ </description> >+ <name>groupingUsed</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Maximum number of digits in the integer >+ portion of the formatted output. >+ </description> >+ <name>maxIntegerDigits</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Minimum number of digits in the integer >+ portion of the formatted output. >+ </description> >+ <name>minIntegerDigits</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Maximum number of digits in the >+ fractional portion of the formatted output. >+ </description> >+ <name>maxFractionDigits</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Minimum number of digits in the >+ fractional portion of the formatted output. >+ </description> >+ <name>minFractionDigits</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Name of the exported scoped variable >+ which stores the formatted result as a >+ String. >+ </description> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Scope of var. >+ </description> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- Parses the string representation of a number, currency, or percentage >- </description> >- <name>parseNumber</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.fmt.ParseNumberTag</tag-class> >- <body-content>JSP</body-content> >- <attribute> >+ <tag> > <description> >-String to be parsed. >+ Parses the string representation of a number, currency, or percentage > </description> >- <name>value</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Specifies whether the string in the value >-attribute should be parsed as a number, >-currency, or percentage. >- </description> >- <name>type</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Custom formatting pattern that determines >-how the string in the value attribute is to be >-parsed. >- </description> >- <name>pattern</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Locale whose default formatting pattern (for >-numbers, currencies, or percentages, >-respectively) is to be used during the parse >-operation, or to which the pattern specified >-via the pattern attribute (if present) is >-applied. >- </description> >- <name>parseLocale</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Specifies whether just the integer portion of >-the given value should be parsed. >- </description> >- <name>integerOnly</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Name of the exported scoped variable which >-stores the parsed result (of type >-java.lang.Number). >- </description> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Scope of var. >- </description> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <name>parseNumber</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.fmt.ParseNumberTag</tag-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ String to be parsed. >+ </description> >+ <name>value</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Specifies whether the string in the value >+ attribute should be parsed as a number, >+ currency, or percentage. >+ </description> >+ <name>type</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Custom formatting pattern that determines >+ how the string in the value attribute is to be >+ parsed. >+ </description> >+ <name>pattern</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Locale whose default formatting pattern (for >+ numbers, currencies, or percentages, >+ respectively) is to be used during the parse >+ operation, or to which the pattern specified >+ via the pattern attribute (if present) is >+ applied. >+ </description> >+ <name>parseLocale</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Specifies whether just the integer portion of >+ the given value should be parsed. >+ </description> >+ <name>integerOnly</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Name of the exported scoped variable which >+ stores the parsed result (of type >+ java.lang.Number). >+ </description> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Scope of var. >+ </description> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- Formats a date and/or time using the supplied styles and pattern >- </description> >- <name>formatDate</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.fmt.FormatDateTag</tag-class> >- <body-content>empty</body-content> >- <attribute> >+ <tag> > <description> >-Date and/or time to be formatted. >+ Formats a date and/or time using the supplied styles and pattern > </description> >- <name>value</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Specifies whether the time, the date, or both >-the time and date components of the given >-date are to be formatted. >- </description> >- <name>type</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Predefined formatting style for dates. Follows >-the semantics defined in class >-java.text.DateFormat. Applied only >-when formatting a date or both a date and >-time (i.e. if type is missing or is equal to >-"date" or "both"); ignored otherwise. >- </description> >- <name>dateStyle</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Predefined formatting style for times. Follows >-the semantics defined in class >-java.text.DateFormat. Applied only >-when formatting a time or both a date and >-time (i.e. if type is equal to "time" or "both"); >-ignored otherwise. >- </description> >- <name>timeStyle</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Custom formatting style for dates and times. >- </description> >- <name>pattern</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Time zone in which to represent the formatted >-time. >- </description> >- <name>timeZone</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Name of the exported scoped variable which >-stores the formatted result as a String. >- </description> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Scope of var. >- </description> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <name>formatDate</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.fmt.FormatDateTag</tag-class> >+ <body-content>empty</body-content> >+ <attribute> >+ <description> >+ Date and/or time to be formatted. >+ </description> >+ <name>value</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Specifies whether the time, the date, or both >+ the time and date components of the given >+ date are to be formatted. >+ </description> >+ <name>type</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Predefined formatting style for dates. Follows >+ the semantics defined in class >+ java.text.DateFormat. Applied only >+ when formatting a date or both a date and >+ time (i.e. if type is missing or is equal to >+ "date" or "both"); ignored otherwise. >+ </description> >+ <name>dateStyle</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Predefined formatting style for times. Follows >+ the semantics defined in class >+ java.text.DateFormat. Applied only >+ when formatting a time or both a date and >+ time (i.e. if type is equal to "time" or "both"); >+ ignored otherwise. >+ </description> >+ <name>timeStyle</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Custom formatting style for dates and times. >+ </description> >+ <name>pattern</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Time zone in which to represent the formatted >+ time. >+ </description> >+ <name>timeZone</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Name of the exported scoped variable which >+ stores the formatted result as a String. >+ </description> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Scope of var. >+ </description> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- Parses the string representation of a date and/or time >- </description> >- <name>parseDate</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.fmt.ParseDateTag</tag-class> >- <body-content>JSP</body-content> >- <attribute> >+ <tag> > <description> >-Date string to be parsed. >+ Parses the string representation of a date and/or time > </description> >- <name>value</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Specifies whether the date string in the >-value attribute is supposed to contain a >-time, a date, or both. >- </description> >- <name>type</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Predefined formatting style for days >-which determines how the date >-component of the date string is to be >-parsed. Applied only when formatting a >-date or both a date and time (i.e. if type >-is missing or is equal to "date" or "both"); >-ignored otherwise. >- </description> >- <name>dateStyle</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Predefined formatting styles for times >-which determines how the time >-component in the date string is to be >-parsed. Applied only when formatting a >-time or both a date and time (i.e. if type >-is equal to "time" or "both"); ignored >-otherwise. >- </description> >- <name>timeStyle</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Custom formatting pattern which >-determines how the date string is to be >-parsed. >- </description> >- <name>pattern</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Time zone in which to interpret any time >-information in the date string. >- </description> >- <name>timeZone</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Locale whose predefined formatting styles >-for dates and times are to be used during >-the parse operation, or to which the >-pattern specified via the pattern >-attribute (if present) is applied. >- </description> >- <name>parseLocale</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Name of the exported scoped variable in >-which the parsing result (of type >-java.util.Date) is stored. >- </description> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Scope of var. >- </description> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <name>parseDate</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.fmt.ParseDateTag</tag-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ Date string to be parsed. >+ </description> >+ <name>value</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Specifies whether the date string in the >+ value attribute is supposed to contain a >+ time, a date, or both. >+ </description> >+ <name>type</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Predefined formatting style for days >+ which determines how the date >+ component of the date string is to be >+ parsed. Applied only when formatting a >+ date or both a date and time (i.e. if type >+ is missing or is equal to "date" or "both"); >+ ignored otherwise. >+ </description> >+ <name>dateStyle</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Predefined formatting styles for times >+ which determines how the time >+ component in the date string is to be >+ parsed. Applied only when formatting a >+ time or both a date and time (i.e. if type >+ is equal to "time" or "both"); ignored >+ otherwise. >+ </description> >+ <name>timeStyle</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Custom formatting pattern which >+ determines how the date string is to be >+ parsed. >+ </description> >+ <name>pattern</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Time zone in which to interpret any time >+ information in the date string. >+ </description> >+ <name>timeZone</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Locale whose predefined formatting styles >+ for dates and times are to be used during >+ the parse operation, or to which the >+ pattern specified via the pattern >+ attribute (if present) is applied. >+ </description> >+ <name>parseLocale</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Name of the exported scoped variable in >+ which the parsing result (of type >+ java.util.Date) is stored. >+ </description> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Scope of var. >+ </description> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > > </taglib> >Index: src/main/resources/META-INF/fmt-1_0-rt.tld >=================================================================== >--- src/main/resources/META-INF/fmt-1_0-rt.tld (revision 1034807) >+++ src/main/resources/META-INF/fmt-1_0-rt.tld (working copy) >@@ -1,403 +1,403 @@ > <?xml version="1.0" encoding="ISO-8859-1" ?> > <!DOCTYPE taglib >- PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" >- "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd"> >+ PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" >+ "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd"> > <taglib> >- <tlib-version>1.0</tlib-version> >- <jsp-version>1.2</jsp-version> >- <short-name>fmt_rt</short-name> >- <uri>http://java.sun.com/jstl/fmt_rt</uri> >- <display-name>JSTL fmt RT</display-name> >- <description>JSTL 1.0 i18n-capable formatting library</description> >+ <tlib-version>1.0</tlib-version> >+ <jsp-version>1.2</jsp-version> >+ <short-name>fmt_rt</short-name> >+ <uri>http://java.sun.com/jstl/fmt_rt</uri> >+ <display-name>JSTL fmt RT</display-name> >+ <description>JSTL 1.0 i18n-capable formatting library</description> > >- <validator> >- <validator-class> >- org.apache.taglibs.standard.tlv.JstlFmtTLV >- </validator-class> >- <description> >- Provides core validation features for JSTL tags. >- </description> >- </validator> >+ <validator> >+ <validator-class> >+ org.apache.taglibs.standard.tlv.JstlFmtTLV >+ </validator-class> >+ <description> >+ Provides core validation features for JSTL tags. >+ </description> >+ </validator> > >- <tag> >- <name>requestEncoding</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.fmt.RequestEncodingTag</tag-class> >- <body-content>empty</body-content> >- <description> >- Sets the request character encoding >- </description> >- <attribute> >- <name>value</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>requestEncoding</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.fmt.RequestEncodingTag</tag-class> >+ <body-content>empty</body-content> >+ <description> >+ Sets the request character encoding >+ </description> >+ <attribute> >+ <name>value</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <name>setLocale</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.fmt.SetLocaleTag</tag-class> >- <body-content>empty</body-content> >- <description> >- Stores the given locale in the locale configuration variable >- </description> >- <attribute> >- <name>value</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>variant</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>setLocale</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.fmt.SetLocaleTag</tag-class> >+ <body-content>empty</body-content> >+ <description> >+ Stores the given locale in the locale configuration variable >+ </description> >+ <attribute> >+ <name>value</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>variant</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <name>timeZone</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.fmt.TimeZoneTag</tag-class> >- <body-content>JSP</body-content> >- <description> >- Specifies the time zone for any time formatting or parsing actions >- nested in its body >- </description> >- <attribute> >- <name>value</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>timeZone</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.fmt.TimeZoneTag</tag-class> >+ <body-content>JSP</body-content> >+ <description> >+ Specifies the time zone for any time formatting or parsing actions >+ nested in its body >+ </description> >+ <attribute> >+ <name>value</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <name>setTimeZone</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.fmt.SetTimeZoneTag</tag-class> >- <body-content>empty</body-content> >- <description> >- Stores the given time zone in the time zone configuration variable >- </description> >- <attribute> >- <name>value</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>setTimeZone</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.fmt.SetTimeZoneTag</tag-class> >+ <body-content>empty</body-content> >+ <description> >+ Stores the given time zone in the time zone configuration variable >+ </description> >+ <attribute> >+ <name>value</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <name>bundle</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.fmt.BundleTag</tag-class> >- <body-content>JSP</body-content> >- <description> >- Loads a resource bundle to be used by its tag body >- </description> >- <attribute> >- <name>basename</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>prefix</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>bundle</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.fmt.BundleTag</tag-class> >+ <body-content>JSP</body-content> >+ <description> >+ Loads a resource bundle to be used by its tag body >+ </description> >+ <attribute> >+ <name>basename</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>prefix</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <name>setBundle</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.fmt.SetBundleTag</tag-class> >- <body-content>empty</body-content> >- <description> >- Loads a resource bundle and stores it in the named scoped variable or >- the bundle configuration variable >- </description> >- <attribute> >- <name>basename</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>setBundle</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.fmt.SetBundleTag</tag-class> >+ <body-content>empty</body-content> >+ <description> >+ Loads a resource bundle and stores it in the named scoped variable or >+ the bundle configuration variable >+ </description> >+ <attribute> >+ <name>basename</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <name>message</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.fmt.MessageTag</tag-class> >- <body-content>JSP</body-content> >- <description> >- Maps key to localized message and performs parametric replacement >- </description> >- <attribute> >- <name>key</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>bundle</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>message</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.fmt.MessageTag</tag-class> >+ <body-content>JSP</body-content> >+ <description> >+ Maps key to localized message and performs parametric replacement >+ </description> >+ <attribute> >+ <name>key</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>bundle</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <name>param</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.fmt.ParamTag</tag-class> >- <body-content>JSP</body-content> >- <description> >- Supplies an argument for parametric replacement to a containing >- <message> tag >- </description> >- <attribute> >- <name>value</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>param</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.fmt.ParamTag</tag-class> >+ <body-content>JSP</body-content> >+ <description> >+ Supplies an argument for parametric replacement to a containing >+ <message> tag >+ </description> >+ <attribute> >+ <name>value</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <name>formatNumber</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.fmt.FormatNumberTag</tag-class> >- <body-content>JSP</body-content> >- <description> >- Formats a numeric value as a number, currency, or percentage >- </description> >- <attribute> >- <name>value</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>type</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>pattern</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>currencyCode</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>currencySymbol</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>groupingUsed</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>maxIntegerDigits</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>minIntegerDigits</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>maxFractionDigits</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>minFractionDigits</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>formatNumber</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.fmt.FormatNumberTag</tag-class> >+ <body-content>JSP</body-content> >+ <description> >+ Formats a numeric value as a number, currency, or percentage >+ </description> >+ <attribute> >+ <name>value</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>type</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>pattern</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>currencyCode</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>currencySymbol</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>groupingUsed</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>maxIntegerDigits</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>minIntegerDigits</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>maxFractionDigits</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>minFractionDigits</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <name>parseNumber</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.fmt.ParseNumberTag</tag-class> >- <body-content>JSP</body-content> >- <description> >- Parses the string representation of a number, currency, or percentage >- </description> >- <attribute> >- <name>value</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>type</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>pattern</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>parseLocale</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>integerOnly</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>parseNumber</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.fmt.ParseNumberTag</tag-class> >+ <body-content>JSP</body-content> >+ <description> >+ Parses the string representation of a number, currency, or percentage >+ </description> >+ <attribute> >+ <name>value</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>type</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>pattern</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>parseLocale</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>integerOnly</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <name>formatDate</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.fmt.FormatDateTag</tag-class> >- <body-content>empty</body-content> >- <description> >- Formats a date and/or time using the supplied styles and pattern >- </description> >- <attribute> >- <name>value</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>type</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>dateStyle</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>timeStyle</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>pattern</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>timeZone</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>formatDate</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.fmt.FormatDateTag</tag-class> >+ <body-content>empty</body-content> >+ <description> >+ Formats a date and/or time using the supplied styles and pattern >+ </description> >+ <attribute> >+ <name>value</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>type</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>dateStyle</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>timeStyle</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>pattern</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>timeZone</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <name>parseDate</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.fmt.ParseDateTag</tag-class> >- <body-content>JSP</body-content> >- <description> >- Parses the string representation of a date and/or time >- </description> >- <attribute> >- <name>value</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>type</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>dateStyle</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>timeStyle</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>pattern</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>timeZone</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>parseLocale</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>parseDate</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.fmt.ParseDateTag</tag-class> >+ <body-content>JSP</body-content> >+ <description> >+ Parses the string representation of a date and/or time >+ </description> >+ <attribute> >+ <name>value</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>type</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>dateStyle</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>timeStyle</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>pattern</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>timeZone</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>parseLocale</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > > </taglib> >Index: src/main/resources/META-INF/x.tld >=================================================================== >--- src/main/resources/META-INF/x.tld (revision 1034807) >+++ src/main/resources/META-INF/x.tld (working copy) >@@ -1,448 +1,448 @@ > <?xml version="1.0" encoding="UTF-8" ?> > > <taglib xmlns="http://java.sun.com/xml/ns/j2ee" >- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" >- version="2.0"> >- >- <description>JSTL 1.1 XML library</description> >- <display-name>JSTL XML</display-name> >- <tlib-version>1.1</tlib-version> >- <short-name>x</short-name> >- <uri>http://java.sun.com/jsp/jstl/xml</uri> >+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" >+ version="2.0"> > >- <validator> >- <description> >- Provides validation features for JSTL XML tags. >- </description> >- <validator-class> >- org.apache.taglibs.standard.tlv.JstlXmlTLV >- </validator-class> >- </validator> >+ <description>JSTL 1.1 XML library</description> >+ <display-name>JSTL XML</display-name> >+ <tlib-version>1.1</tlib-version> >+ <short-name>x</short-name> >+ <uri>http://java.sun.com/jsp/jstl/xml</uri> > >- <tag> >- <description> >- Simple conditional tag that establishes a context for >- mutually exclusive conditional operations, marked by >- <when> and <otherwise> >- </description> >- <name>choose</name> >- <tag-class>org.apache.taglibs.standard.tag.common.core.ChooseTag</tag-class> >- <body-content>JSP</body-content> >- </tag> >- >- <tag> >- <description> >- Like <%= ... >, but for XPath expressions. >- </description> >- <name>out</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.xml.ExprTag</tag-class> >- <body-content>empty</body-content> >- <attribute> >+ <validator> > <description> >-XPath expression to be evaluated. >+ Provides validation features for JSTL XML tags. > </description> >- <name>select</name> >- <required>true</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >+ <validator-class> >+ org.apache.taglibs.standard.tlv.JstlXmlTLV >+ </validator-class> >+ </validator> >+ >+ <tag> > <description> >-Determines whether characters <,>,&,'," in the >-resulting string should be converted to their >-corresponding character entity codes. Default >-value is true. >+ Simple conditional tag that establishes a context for >+ mutually exclusive conditional operations, marked by >+ <when> and <otherwise> > </description> >- <name>escapeXml</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <name>choose</name> >+ <tag-class>org.apache.taglibs.standard.tag.common.core.ChooseTag</tag-class> >+ <body-content>JSP</body-content> >+ </tag> > >- <tag> >- <description> >- XML conditional tag, which evalutes its body if the >- supplied XPath expression evalutes to 'true' as a boolean >- </description> >- <name>if</name> >- <tag-class>org.apache.taglibs.standard.tag.common.xml.IfTag</tag-class> >- <body-content>JSP</body-content> >- <attribute> >+ <tag> > <description> >-The test condition that tells whether or not the >-body content should be processed. >+ Like <%= ... >, but for XPath expressions. > </description> >- <name>select</name> >- <required>true</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >+ <name>out</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.xml.ExprTag</tag-class> >+ <body-content>empty</body-content> >+ <attribute> >+ <description> >+ XPath expression to be evaluated. >+ </description> >+ <name>select</name> >+ <required>true</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Determines whether characters <,>,&,'," in the >+ resulting string should be converted to their >+ corresponding character entity codes. Default >+ value is true. >+ </description> >+ <name>escapeXml</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> >+ >+ <tag> > <description> >-Name of the exported scoped variable for the >-resulting value of the test condition. The type >-of the scoped variable is Boolean. >+ XML conditional tag, which evalutes its body if the >+ supplied XPath expression evalutes to 'true' as a boolean > </description> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >+ <name>if</name> >+ <tag-class>org.apache.taglibs.standard.tag.common.xml.IfTag</tag-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ The test condition that tells whether or not the >+ body content should be processed. >+ </description> >+ <name>select</name> >+ <required>true</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Name of the exported scoped variable for the >+ resulting value of the test condition. The type >+ of the scoped variable is Boolean. >+ </description> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Scope for var. >+ </description> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> >+ >+ <tag> > <description> >-Scope for var. >+ XML iteration tag. > </description> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <name>forEach</name> >+ <tag-class>org.apache.taglibs.standard.tag.common.xml.ForEachTag</tag-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ Name of the exported scoped variable for the >+ current item of the iteration. This scoped variable >+ has nested visibility. Its type depends on the >+ result of the XPath expression in the select >+ attribute. >+ </description> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ XPath expression to be evaluated. >+ </description> >+ <name>select</name> >+ <required>true</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Iteration begins at the item located at the >+ specified index. First item of the collection has >+ index 0. >+ </description> >+ <name>begin</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ <type>int</type> >+ </attribute> >+ <attribute> >+ <description> >+ Iteration ends at the item located at the specified >+ index (inclusive). >+ </description> >+ <name>end</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ <type>int</type> >+ </attribute> >+ <attribute> >+ <description> >+ Iteration will only process every step items of >+ the collection, starting with the first one. >+ </description> >+ <name>step</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ <type>int</type> >+ </attribute> >+ <attribute> >+ <description> >+ Name of the exported scoped variable for the >+ status of the iteration. Object exported is of type >+ javax.servlet.jsp.jstl.core.LoopTagStatus. This scoped variable has nested visibility. >+ </description> >+ <name>varStatus</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- XML iteration tag. >- </description> >- <name>forEach</name> >- <tag-class>org.apache.taglibs.standard.tag.common.xml.ForEachTag</tag-class> >- <body-content>JSP</body-content> >- <attribute> >+ <tag> > <description> >-Name of the exported scoped variable for the >-current item of the iteration. This scoped variable >-has nested visibility. Its type depends on the >-result of the XPath expression in the select >-attribute. >+ Subtag of <choose> that follows <when> tags >+ and runs only if all of the prior conditions evaluated to >+ 'false' > </description> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-XPath expression to be evaluated. >- </description> >- <name>select</name> >- <required>true</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Iteration begins at the item located at the >-specified index. First item of the collection has >-index 0. >- </description> >- <name>begin</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- <type>int</type> >- </attribute> >- <attribute> >- <description> >-Iteration ends at the item located at the specified >-index (inclusive). >- </description> >- <name>end</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- <type>int</type> >- </attribute> >- <attribute> >- <description> >-Iteration will only process every step items of >-the collection, starting with the first one. >- </description> >- <name>step</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- <type>int</type> >- </attribute> >- <attribute> >- <description> >-Name of the exported scoped variable for the >-status of the iteration. Object exported is of type >-javax.servlet.jsp.jstl.core.LoopTagStatus. This scoped variable has nested visibility. >- </description> >- <name>varStatus</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <name>otherwise</name> >+ <tag-class>org.apache.taglibs.standard.tag.common.core.OtherwiseTag</tag-class> >+ <body-content>JSP</body-content> >+ </tag> > >- <tag> >- <description> >- Subtag of <choose> that follows <when> tags >- and runs only if all of the prior conditions evaluated to >- 'false' >- </description> >- <name>otherwise</name> >- <tag-class>org.apache.taglibs.standard.tag.common.core.OtherwiseTag</tag-class> >- <body-content>JSP</body-content> >- </tag> >- >- <tag> >- <description> >- Adds a parameter to a containing 'transform' tag's Transformer >- </description> >- <name>param</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.xml.ParamTag</tag-class> >- <body-content>JSP</body-content> >- <attribute> >+ <tag> > <description> >-Name of the transformation parameter. >+ Adds a parameter to a containing 'transform' tag's Transformer > </description> >- <name>name</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Value of the parameter. >- </description> >- <name>value</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <name>param</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.xml.ParamTag</tag-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ Name of the transformation parameter. >+ </description> >+ <name>name</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Value of the parameter. >+ </description> >+ <name>value</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- Parses XML content from 'source' attribute or 'body' >- </description> >- <name>parse</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.xml.ParseTag</tag-class> >- <tei-class>org.apache.taglibs.standard.tei.XmlParseTEI</tei-class> >- <body-content>JSP</body-content> >- <attribute> >+ <tag> > <description> >-Name of the exported scoped variable for >-the parsed XML document. The type of the >-scoped variable is implementation >-dependent. >+ Parses XML content from 'source' attribute or 'body' > </description> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Name of the exported scoped variable for >-the parsed XML document. The type of the >-scoped variable is >-org.w3c.dom.Document. >- </description> >- <name>varDom</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Scope for var. >- </description> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Scope for varDom. >- </description> >- <name>scopeDom</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Deprecated. Use attribute 'doc' instead. >- </description> >- <name>xml</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Source XML document to be parsed. >- </description> >- <name>doc</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-The system identifier (URI) for parsing the >-XML document. >- </description> >- <name>systemId</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Filter to be applied to the source >-document. >- </description> >- <name>filter</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <name>parse</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.xml.ParseTag</tag-class> >+ <tei-class>org.apache.taglibs.standard.tei.XmlParseTEI</tei-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ Name of the exported scoped variable for >+ the parsed XML document. The type of the >+ scoped variable is implementation >+ dependent. >+ </description> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Name of the exported scoped variable for >+ the parsed XML document. The type of the >+ scoped variable is >+ org.w3c.dom.Document. >+ </description> >+ <name>varDom</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Scope for var. >+ </description> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Scope for varDom. >+ </description> >+ <name>scopeDom</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Deprecated. Use attribute 'doc' instead. >+ </description> >+ <name>xml</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Source XML document to be parsed. >+ </description> >+ <name>doc</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ The system identifier (URI) for parsing the >+ XML document. >+ </description> >+ <name>systemId</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Filter to be applied to the source >+ document. >+ </description> >+ <name>filter</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- Saves the result of an XPath expression evaluation in a 'scope' >- </description> >- <name>set</name> >- <tag-class>org.apache.taglibs.standard.tag.common.xml.SetTag</tag-class> >- <body-content>empty</body-content> >- <attribute> >+ <tag> > <description> >-Name of the exported scoped variable to hold >-the value specified in the action. The type of the >-scoped variable is whatever type the select >-expression evaluates to. >+ Saves the result of an XPath expression evaluation in a 'scope' > </description> >- <name>var</name> >- <required>true</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-XPath expression to be evaluated. >- </description> >- <name>select</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Scope for var. >- </description> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <name>set</name> >+ <tag-class>org.apache.taglibs.standard.tag.common.xml.SetTag</tag-class> >+ <body-content>empty</body-content> >+ <attribute> >+ <description> >+ Name of the exported scoped variable to hold >+ the value specified in the action. The type of the >+ scoped variable is whatever type the select >+ expression evaluates to. >+ </description> >+ <name>var</name> >+ <required>true</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ XPath expression to be evaluated. >+ </description> >+ <name>select</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Scope for var. >+ </description> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- Conducts a transformation given a source XML document >- and an XSLT stylesheet >- </description> >- <name>transform</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.xml.TransformTag</tag-class> >- <tei-class>org.apache.taglibs.standard.tei.XmlTransformTEI</tei-class> >- <body-content>JSP</body-content> >- <attribute> >+ <tag> > <description> >-Name of the exported >-scoped variable for the >-transformed XML >-document. The type of the >-scoped variable is >-org.w3c.dom.Document. >+ Conducts a transformation given a source XML document >+ and an XSLT stylesheet > </description> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Scope for var. >- </description> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Result >-Object that captures or >-processes the transformation >-result. >- </description> >- <name>result</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Deprecated. Use attribute >-'doc' instead. >- </description> >- <name>xml</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Source XML document to be >-transformed. (If exported by >-<x:set>, it must correspond >-to a well-formed XML >-document, not a partial >-document.) >- </description> >- <name>doc</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-Deprecated. Use attribute >-'docSystemId' instead. >- </description> >- <name>xmlSystemId</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-The system identifier (URI) >-for parsing the XML >-document. >- </description> >- <name>docSystemId</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-javax.xml.transform.Source >-Transformation stylesheet as >-a String, Reader, or >-Source object. >- </description> >- <name>xslt</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <description> >-The system identifier (URI) >-for parsing the XSLT >-stylesheet. >- </description> >- <name>xsltSystemId</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <name>transform</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.xml.TransformTag</tag-class> >+ <tei-class>org.apache.taglibs.standard.tei.XmlTransformTEI</tei-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ Name of the exported >+ scoped variable for the >+ transformed XML >+ document. The type of the >+ scoped variable is >+ org.w3c.dom.Document. >+ </description> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Scope for var. >+ </description> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Result >+ Object that captures or >+ processes the transformation >+ result. >+ </description> >+ <name>result</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Deprecated. Use attribute >+ 'doc' instead. >+ </description> >+ <name>xml</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Source XML document to be >+ transformed. (If exported by >+ <x:set>, it must correspond >+ to a well-formed XML >+ document, not a partial >+ document.) >+ </description> >+ <name>doc</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ Deprecated. Use attribute >+ 'docSystemId' instead. >+ </description> >+ <name>xmlSystemId</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ The system identifier (URI) >+ for parsing the XML >+ document. >+ </description> >+ <name>docSystemId</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ javax.xml.transform.Source >+ Transformation stylesheet as >+ a String, Reader, or >+ Source object. >+ </description> >+ <name>xslt</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <description> >+ The system identifier (URI) >+ for parsing the XSLT >+ stylesheet. >+ </description> >+ <name>xsltSystemId</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <description> >- Subtag of <choose> that includes its body if its >- expression evalutes to 'true' >- </description> >- <name>when</name> >- <tag-class>org.apache.taglibs.standard.tag.common.xml.WhenTag</tag-class> >- <body-content>JSP</body-content> >- <attribute> >+ <tag> > <description> >-The test condition that tells whether or >-not the body content should be >-processed >+ Subtag of <choose> that includes its body if its >+ expression evalutes to 'true' > </description> >- <name>select</name> >- <required>true</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <name>when</name> >+ <tag-class>org.apache.taglibs.standard.tag.common.xml.WhenTag</tag-class> >+ <body-content>JSP</body-content> >+ <attribute> >+ <description> >+ The test condition that tells whether or >+ not the body content should be >+ processed >+ </description> >+ <name>select</name> >+ <required>true</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > > </taglib> >Index: src/main/resources/META-INF/x-1_0-rt.tld >=================================================================== >--- src/main/resources/META-INF/x-1_0-rt.tld (revision 1034807) >+++ src/main/resources/META-INF/x-1_0-rt.tld (working copy) >@@ -1,256 +1,256 @@ > <?xml version="1.0" encoding="ISO-8859-1" ?> > <!DOCTYPE taglib >- PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" >- "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd"> >+ PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" >+ "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd"> > <taglib> >- <tlib-version>1.0</tlib-version> >- <jsp-version>1.2</jsp-version> >- <short-name>x_rt</short-name> >- <uri>http://java.sun.com/jstl/xml_rt</uri> >- <display-name>JSTL XML RT</display-name> >- <description>JSTL 1.0 XML library</description> >+ <tlib-version>1.0</tlib-version> >+ <jsp-version>1.2</jsp-version> >+ <short-name>x_rt</short-name> >+ <uri>http://java.sun.com/jstl/xml_rt</uri> >+ <display-name>JSTL XML RT</display-name> >+ <description>JSTL 1.0 XML library</description> > >- <validator> >- <validator-class> >- org.apache.taglibs.standard.tlv.JstlXmlTLV >- </validator-class> >- <description> >- Provides validation features for JSTL XML tags. >- </description> >- </validator> >+ <validator> >+ <validator-class> >+ org.apache.taglibs.standard.tlv.JstlXmlTLV >+ </validator-class> >+ <description> >+ Provides validation features for JSTL XML tags. >+ </description> >+ </validator> > >- <tag> >- <name>choose</name> >- <tag-class>org.apache.taglibs.standard.tag.common.core.ChooseTag</tag-class> >- <body-content>JSP</body-content> >- <description> >- Simple conditional tag that establishes a context for >- mutually exclusive conditional operations, marked by >- <when> and <otherwise> >- </description> >- </tag> >+ <tag> >+ <name>choose</name> >+ <tag-class>org.apache.taglibs.standard.tag.common.core.ChooseTag</tag-class> >+ <body-content>JSP</body-content> >+ <description> >+ Simple conditional tag that establishes a context for >+ mutually exclusive conditional operations, marked by >+ <when> and <otherwise> >+ </description> >+ </tag> > >- <tag> >- <name>out</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.xml.ExprTag</tag-class> >- <body-content>empty</body-content> >- <description> >- Like <%= ... >, but for XPath expressions. >- </description> >- <attribute> >- <name>select</name> >- <required>true</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>escapeXml</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>out</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.xml.ExprTag</tag-class> >+ <body-content>empty</body-content> >+ <description> >+ Like <%= ... >, but for XPath expressions. >+ </description> >+ <attribute> >+ <name>select</name> >+ <required>true</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>escapeXml</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <name>if</name> >- <tag-class>org.apache.taglibs.standard.tag.common.xml.IfTag</tag-class> >- <body-content>JSP</body-content> >- <description> >- XML conditional tag, which evalutes its body if the >- supplied XPath expression evalutes to 'true' as a boolean >- </description> >- <attribute> >- <name>select</name> >- <required>true</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>if</name> >+ <tag-class>org.apache.taglibs.standard.tag.common.xml.IfTag</tag-class> >+ <body-content>JSP</body-content> >+ <description> >+ XML conditional tag, which evalutes its body if the >+ supplied XPath expression evalutes to 'true' as a boolean >+ </description> >+ <attribute> >+ <name>select</name> >+ <required>true</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <name>forEach</name> >- <tag-class>org.apache.taglibs.standard.tag.common.xml.ForEachTag</tag-class> >- <body-content>JSP</body-content> >- <description> >- XML iteration tag. >- </description> >- <attribute> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>select</name> >- <required>true</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>forEach</name> >+ <tag-class>org.apache.taglibs.standard.tag.common.xml.ForEachTag</tag-class> >+ <body-content>JSP</body-content> >+ <description> >+ XML iteration tag. >+ </description> >+ <attribute> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>select</name> >+ <required>true</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <name>otherwise</name> >- <tag-class>org.apache.taglibs.standard.tag.common.core.OtherwiseTag</tag-class> >- <body-content>JSP</body-content> >- <description> >- Subtag of <choose> that follows <when> tags >- and runs only if all of the prior conditions evaluated to >- 'false' >- </description> >- </tag> >+ <tag> >+ <name>otherwise</name> >+ <tag-class>org.apache.taglibs.standard.tag.common.core.OtherwiseTag</tag-class> >+ <body-content>JSP</body-content> >+ <description> >+ Subtag of <choose> that follows <when> tags >+ and runs only if all of the prior conditions evaluated to >+ 'false' >+ </description> >+ </tag> > >- <tag> >- <name>param</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.xml.ParamTag</tag-class> >- <body-content>JSP</body-content> >- <description> >- Adds a parameter to a containing 'transform' tag's Transformer >- </description> >- <attribute> >- <name>name</name> >- <required>true</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>value</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>param</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.xml.ParamTag</tag-class> >+ <body-content>JSP</body-content> >+ <description> >+ Adds a parameter to a containing 'transform' tag's Transformer >+ </description> >+ <attribute> >+ <name>name</name> >+ <required>true</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>value</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <name>parse</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.xml.ParseTag</tag-class> >- <tei-class>org.apache.taglibs.standard.tei.XmlParseTEI</tei-class> >- <body-content>JSP</body-content> >- <description> >- Parses XML content from 'source' attribute or 'body' >- </description> >- <attribute> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>varDom</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>scopeDom</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>xml</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>systemId</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>filter</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>parse</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.xml.ParseTag</tag-class> >+ <tei-class>org.apache.taglibs.standard.tei.XmlParseTEI</tei-class> >+ <body-content>JSP</body-content> >+ <description> >+ Parses XML content from 'source' attribute or 'body' >+ </description> >+ <attribute> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>varDom</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>scopeDom</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>xml</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>systemId</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>filter</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <name>set</name> >- <tag-class>org.apache.taglibs.standard.tag.common.xml.SetTag</tag-class> >- <body-content>empty</body-content> >- <description> >- Saves the result of an XPath expression evaluation in a 'scope' >- </description> >- <attribute> >- <name>var</name> >- <required>true</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>select</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>set</name> >+ <tag-class>org.apache.taglibs.standard.tag.common.xml.SetTag</tag-class> >+ <body-content>empty</body-content> >+ <description> >+ Saves the result of an XPath expression evaluation in a 'scope' >+ </description> >+ <attribute> >+ <name>var</name> >+ <required>true</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>select</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <name>transform</name> >- <tag-class>org.apache.taglibs.standard.tag.rt.xml.TransformTag</tag-class> >- <tei-class>org.apache.taglibs.standard.tei.XmlTransformTEI</tei-class> >- <body-content>JSP</body-content> >- <description> >- Conducts a transformation given a source XML document >- and an XSLT stylesheet >- </description> >- <attribute> >- <name>var</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>scope</name> >- <required>false</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- <attribute> >- <name>result</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>xml</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>xmlSystemId</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>xslt</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- <attribute> >- <name>xsltSystemId</name> >- <required>false</required> >- <rtexprvalue>true</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>transform</name> >+ <tag-class>org.apache.taglibs.standard.tag.rt.xml.TransformTag</tag-class> >+ <tei-class>org.apache.taglibs.standard.tei.XmlTransformTEI</tei-class> >+ <body-content>JSP</body-content> >+ <description> >+ Conducts a transformation given a source XML document >+ and an XSLT stylesheet >+ </description> >+ <attribute> >+ <name>var</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>scope</name> >+ <required>false</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>result</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>xml</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>xmlSystemId</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>xslt</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ <attribute> >+ <name>xsltSystemId</name> >+ <required>false</required> >+ <rtexprvalue>true</rtexprvalue> >+ </attribute> >+ </tag> > >- <tag> >- <name>when</name> >- <tag-class>org.apache.taglibs.standard.tag.common.xml.WhenTag</tag-class> >- <body-content>JSP</body-content> >- <description> >- Subtag of <choose> that includes its body if its >- expression evalutes to 'true' >- </description> >- <attribute> >- <name>select</name> >- <required>true</required> >- <rtexprvalue>false</rtexprvalue> >- </attribute> >- </tag> >+ <tag> >+ <name>when</name> >+ <tag-class>org.apache.taglibs.standard.tag.common.xml.WhenTag</tag-class> >+ <body-content>JSP</body-content> >+ <description> >+ Subtag of <choose> that includes its body if its >+ expression evalutes to 'true' >+ </description> >+ <attribute> >+ <name>select</name> >+ <required>true</required> >+ <rtexprvalue>false</rtexprvalue> >+ </attribute> >+ </tag> > > </taglib> >Index: pom.xml >=================================================================== >--- pom.xml (revision 1034807) >+++ pom.xml (working copy) >@@ -20,157 +20,198 @@ > Enable Cactus tests > --> > <project >- xmlns="http://maven.apache.org/POM/4.0.0" >- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> >- <modelVersion>4.0.0</modelVersion> >- <parent> >- <groupId>org.apache.taglibs</groupId> >- <artifactId>taglibs-parent</artifactId> >- <version>1-SNAPSHOT</version> >- </parent> >+ xmlns="http://maven.apache.org/POM/4.0.0" >+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> >+ <modelVersion>4.0.0</modelVersion> >+ <parent> >+ <groupId>org.apache.taglibs</groupId> >+ <artifactId>taglibs-parent</artifactId> >+ <version>1-SNAPSHOT</version> >+ </parent> > >- <artifactId>taglibs-standard-impl</artifactId> >- <version>1.2-SNAPSHOT</version> >- <packaging>bundle</packaging> >+ <artifactId>taglibs-standard-impl</artifactId> >+ <version>1.2-SNAPSHOT</version> >+ <packaging>bundle</packaging> > >- <name>Apache Standard Taglib - JSTL Implementation</name> >+ <name>Apache Standard Taglib - JSTL Implementation</name> > >- <inceptionYear>2001</inceptionYear> >- <description> >- An implementation of the JSP Standard Tag Library (JSTL). >- </description> >+ <inceptionYear>2001</inceptionYear> >+ <description> >+ An implementation of the JSP Standard Tag Library (JSTL). >+ </description> > >- <url>http://tomcat.apache.org/taglibs/standard/</url> >+ <url>http://tomcat.apache.org/taglibs/standard/</url> > >- <scm> >- <connection>scm:svn:http://svn.apache.org/repos/asf/tomcat/taglibs/standard/trunk/impl</connection> >- <developerConnection>scm:svn:https://svn.apache.org/repos/asf/tomcat/taglibs/standard/trunk/impl</developerConnection> >- <url>http://svn.apache.org/viewvc/tomcat/taglibs/standard/trunk/impl</url> >- </scm> >+ <scm> >+ <connection>scm:svn:http://svn.apache.org/repos/asf/tomcat/taglibs/standard/trunk/impl</connection> >+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/tomcat/taglibs/standard/trunk/impl >+ </developerConnection> >+ <url>http://svn.apache.org/viewvc/tomcat/taglibs/standard/trunk/impl</url> >+ </scm> > >- <developers> >- <developer><name>Pierre Delisle</name></developer> >- <developer><name>Shawn Bayern</name></developer> >- <developer><name>Nathan Abramson</name></developer> >- <developer><name>Hans Bergsten</name></developer> >- <developer><name>Scott Hasse</name></developer> >- <developer><name>Justyna Horwat</name></developer> >- <developer><name>Mark Kolb</name></developer> >- <developer><name>Jan Luehe</name></developer> >- <developer><name>Glenn Nielsen</name></developer> >- <developer><name>Dmitri Plotnikov</name></developer> >- <developer><name>Felipe Leme</name></developer> >- <developer><name>Henri Yandell</name></developer> >- <developer><name>Bjorn Townsend</name></developer> >- </developers> >+ <developers> >+ <developer> >+ <name>Pierre Delisle</name> >+ </developer> >+ <developer> >+ <name>Shawn Bayern</name> >+ </developer> >+ <developer> >+ <name>Nathan Abramson</name> >+ </developer> >+ <developer> >+ <name>Hans Bergsten</name> >+ </developer> >+ <developer> >+ <name>Scott Hasse</name> >+ </developer> >+ <developer> >+ <name>Justyna Horwat</name> >+ </developer> >+ <developer> >+ <name>Mark Kolb</name> >+ </developer> >+ <developer> >+ <name>Jan Luehe</name> >+ </developer> >+ <developer> >+ <name>Glenn Nielsen</name> >+ </developer> >+ <developer> >+ <name>Dmitri Plotnikov</name> >+ </developer> >+ <developer> >+ <name>Felipe Leme</name> >+ </developer> >+ <developer> >+ <name>Henri Yandell</name> >+ </developer> >+ <developer> >+ <name>Bjorn Townsend</name> >+ </developer> >+ </developers> > >- <contributors> >- <contributor><name>Robert Goff</name></contributor> >- </contributors> >+ <contributors> >+ <contributor> >+ <name>Robert Goff</name> >+ </contributor> >+ </contributors> > >- <dependencies> >- <dependency> >- <groupId>org.apache.taglibs</groupId> >- <artifactId>taglibs-standard-spec</artifactId> >- <version>1.2-SNAPSHOT</version> >- <scope>provided</scope> >- </dependency> >+ <dependencies> >+ <dependency> >+ <groupId>org.apache.taglibs</groupId> >+ <artifactId>taglibs-standard-spec</artifactId> >+ <version>1.2-SNAPSHOT</version> >+ <scope>provided</scope> >+ </dependency> > >- <dependency> >- <groupId>javax.servlet</groupId> >- <artifactId>servlet-api</artifactId> >- <version>2.5</version> >- <scope>provided</scope> >- </dependency> >- <dependency> >- <groupId>javax.servlet.jsp</groupId> >- <artifactId>jsp-api</artifactId> >- <version>2.1</version> >- <scope>provided</scope> >- </dependency> >- <dependency> >- <groupId>javax.el</groupId> >- <artifactId>el-api</artifactId> >- <version>1.0</version> >- <scope>provided</scope> >- </dependency> >- <dependency> >- <groupId>xalan</groupId> >- <artifactId>xalan</artifactId> >- <version>2.7.1</version> >- <scope>provided</scope> >- </dependency> >+ <dependency> >+ <groupId>javax.servlet</groupId> >+ <artifactId>servlet-api</artifactId> >+ <version>2.5</version> >+ <scope>provided</scope> >+ </dependency> >+ <dependency> >+ <groupId>javax.servlet.jsp</groupId> >+ <artifactId>jsp-api</artifactId> >+ <version>2.1</version> >+ <scope>provided</scope> >+ </dependency> >+ <dependency> >+ <groupId>javax.el</groupId> >+ <artifactId>el-api</artifactId> >+ <version>1.0</version> >+ <scope>provided</scope> >+ </dependency> >+ <dependency> >+ <groupId>xalan</groupId> >+ <artifactId>xalan</artifactId> >+ <version>2.7.1</version> >+ <scope>provided</scope> >+ </dependency> > >- <dependency> >- <groupId>junit</groupId> >- <artifactId>junit</artifactId> >- <version>4.8.1</version> >- <scope>test</scope> >- </dependency> >- <dependency> >- <groupId>org.easymock</groupId> >- <artifactId>easymock</artifactId> >- <version>3.0</version> >- <scope>test</scope> >- </dependency> >- </dependencies> >+ <dependency> >+ <groupId>junit</groupId> >+ <artifactId>junit</artifactId> >+ <version>4.8.1</version> >+ <scope>test</scope> >+ </dependency> >+ <dependency> >+ <groupId>org.easymock</groupId> >+ <artifactId>easymock</artifactId> >+ <version>3.0</version> >+ <scope>test</scope> >+ </dependency> >+ </dependencies> > >- <build> >- <plugins> >- <plugin> >- <groupId>org.apache.felix</groupId> >- <artifactId>maven-bundle-plugin</artifactId> >- <configuration> >- <excludeDependencies>true</excludeDependencies> >- <instructions> >- <Export-Package>*;version="1.2"</Export-Package> >- <Import-Package>org.apache.x*;resolution:=optional,*</Import-Package> >- </instructions> >- </configuration> >- </plugin> >- </plugins> >- </build> >- >- <reporting> >- <plugins> >- <plugin> >- <artifactId>maven-pmd-plugin</artifactId> >- <version>2.3</version> >- <configuration> >- <targetJdk>${maven.compiler.target}</targetJdk> >- </configuration> >- <reportSets> >- <reportSet> >- <reports> >- <report>pmd</report> >- <report>cpd</report> >- </reports> >- </reportSet> >- </reportSets> >- </plugin> >- <plugin> >- <groupId>org.codehaus.mojo</groupId> >- <artifactId>taglist-maven-plugin</artifactId> >- <version>2.4</version> >- </plugin> >- <plugin> >- <groupId>org.codehaus.mojo</groupId> >- <artifactId>javancss-maven-plugin</artifactId> >- <version>2.0</version> >- </plugin> >- <plugin> >- <groupId>org.codehaus.mojo</groupId> >- <artifactId>findbugs-maven-plugin</artifactId> >- <version>1.2</version> >- <configuration> >- <threshold>Normal</threshold> >- <effort>Default</effort> >-<!-- <excludeFilterFile>${basedir}/findbugs-exclude-filter.xml</excludeFilterFile> --> >- </configuration> >- </plugin> >- </plugins> >- </reporting> >+ <build> >+ <plugins> >+ <plugin> >+ <groupId>org.apache.felix</groupId> >+ <artifactId>maven-bundle-plugin</artifactId> >+ <configuration> >+ <excludeDependencies>true</excludeDependencies> >+ <instructions> >+ <Export-Package>*;version="1.2"</Export-Package> >+ <Import-Package>org.apache.x*;resolution:=optional,*</Import-Package> >+ </instructions> >+ </configuration> >+ </plugin> >+ </plugins> >+ </build> > >+ <reporting> >+ <plugins> >+ <plugin> >+ <groupId>org.codehaus.mojo</groupId> >+ <artifactId>jxr-maven-plugin</artifactId> >+ </plugin> >+ <plugin> >+ <artifactId>maven-pmd-plugin</artifactId> >+ <version>2.3</version> >+ <configuration> >+ <targetJdk>${maven.compiler.target}</targetJdk> >+ </configuration> >+ <reportSets> >+ <reportSet> >+ <reports> >+ <report>pmd</report> >+ <report>cpd</report> >+ </reports> >+ </reportSet> >+ </reportSets> >+ </plugin> >+ <plugin> >+ <groupId>org.codehaus.mojo</groupId> >+ <artifactId>taglist-maven-plugin</artifactId> >+ <version>2.4</version> >+ </plugin> >+ <plugin> >+ <groupId>org.codehaus.mojo</groupId> >+ <artifactId>javancss-maven-plugin</artifactId> >+ <version>2.0</version> >+ </plugin> >+ <plugin> >+ <groupId>org.codehaus.mojo</groupId> >+ <artifactId>findbugs-maven-plugin</artifactId> >+ <version>1.2</version> >+ <configuration> >+ <threshold>Normal</threshold> >+ <effort>Default</effort> >+ <!-- <excludeFilterFile>${basedir}/findbugs-exclude-filter.xml</excludeFilterFile> --> >+ </configuration> >+ </plugin> >+ <plugin> >+ <groupId>org.apache.maven.plugins</groupId> >+ <artifactId>maven-checkstyle-plugin</artifactId> >+ <version>2.6</version> >+ <configuration> >+ <configLocation>checkstyle.xml</configLocation> >+ </configuration> >+ </plugin> >+ </plugins> >+ </reporting> > >+ > </project>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 50279
:
26301
| 26304