ASF Bugzilla – Attachment 22121 Details for
Bug 45197
Need to support the JSTL 1.2 specification
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
The attachment implements the JSTL 1.2 specification changes.
jstl1.2Patch.txt (text/plain), 57.04 KB, created by
Robert Goff
on 2008-06-12 15:06:51 UTC
(
hide
)
Description:
The attachment implements the JSTL 1.2 specification changes.
Filename:
MIME Type:
Creator:
Robert Goff
Created:
2008-06-12 15:06:51 UTC
Size:
57.04 KB
patch
obsolete
>Index: conf/c-1_1.tld >=================================================================== >--- conf/c-1_1.tld (revision 0) >+++ conf/c-1_1.tld (revision 0) >@@ -0,0 +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> >+ >+ <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> >+ <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> >+ 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> >+ <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> >+ <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> >+ <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> >+ <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> >+ <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> >+ <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> >+ <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> >+ <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> >+ <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> >+ <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> >+ <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: conf/c.tld >=================================================================== >--- conf/c.tld (revision 655871) >+++ conf/c.tld (working copy) >@@ -1,13 +1,13 @@ > <?xml version="1.0" encoding="UTF-8" ?> > >-<taglib xmlns="http://java.sun.com/xml/ns/j2ee" >+<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/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" >- version="2.0"> >- >- <description>JSTL 1.1 core library</description> >+ 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.1</tlib-version> >+ <tlib-version>1.2</tlib-version> > <short-name>c</short-name> > <uri>http://java.sun.com/jsp/jstl/core</uri> > >@@ -174,6 +174,9 @@ > <required>false</required> > <rtexprvalue>true</rtexprvalue> > <type>java.lang.Object</type> >+ <deferred-value> >+ <type>java.lang.Object</type> >+ </deferred-value> > </attribute> > <attribute> > <description> >@@ -253,6 +256,9 @@ > <required>true</required> > <rtexprvalue>true</rtexprvalue> > <type>java.lang.String</type> >+ <deferred-value> >+ <type>java.lang.String</type> >+ </deferred-value> > </attribute> > <attribute> > <description> >@@ -467,6 +473,9 @@ > <name>value</name> > <required>false</required> > <rtexprvalue>true</rtexprvalue> >+ <deferred-value> >+ <type>java.lang.Object</type> >+ </deferred-value> > </attribute> > <attribute> > <description> >Index: src/org/apache/taglibs/standard/lang/jstl/test/PageContextImpl.java >=================================================================== >--- src/org/apache/taglibs/standard/lang/jstl/test/PageContextImpl.java (revision 655871) >+++ src/org/apache/taglibs/standard/lang/jstl/test/PageContextImpl.java (working copy) >@@ -31,6 +31,7 @@ > import javax.servlet.jsp.PageContext; > import javax.servlet.jsp.el.ExpressionEvaluator; > import javax.servlet.jsp.el.VariableResolver; >+import javax.el.ELContext; > > /** > * >@@ -298,4 +299,5 @@ > public ExpressionEvaluator getExpressionEvaluator() { return null; } > public VariableResolver getVariableResolver() { return null; } > >+ public ELContext getELContext() { return null; } > } >Index: src/org/apache/taglibs/standard/extra/spath/SPathFilter.java >=================================================================== >--- src/org/apache/taglibs/standard/extra/spath/SPathFilter.java (revision 655871) >+++ src/org/apache/taglibs/standard/extra/spath/SPathFilter.java (working copy) >@@ -20,9 +20,9 @@ > import java.util.List; > import java.util.Stack; > >-import org.apache.xalan.serialize.Serializer; >-import org.apache.xalan.serialize.SerializerFactory; >-import org.apache.xalan.templates.OutputProperties; >+import org.apache.xml.serializer.Serializer; >+import org.apache.xml.serializer.SerializerFactory; >+import org.apache.xml.serializer.OutputPropertiesFactory; > import org.xml.sax.Attributes; > import org.xml.sax.InputSource; > import org.xml.sax.SAXException; >@@ -76,7 +76,7 @@ > f1.setParent(r); > f2.setParent(f1); > Serializer sz = SerializerFactory.getSerializer >- (OutputProperties.getDefaultMethodProperties("xml")); >+ (OutputPropertiesFactory.getDefaultMethodProperties("xml")); > sz.setOutputStream(System.out); > f2.setContentHandler(sz.asContentHandler()); > >Index: src/org/apache/taglibs/standard/tag/rt/core/ForTokensTag.java >=================================================================== >--- src/org/apache/taglibs/standard/tag/rt/core/ForTokensTag.java (revision 655871) >+++ src/org/apache/taglibs/standard/tag/rt/core/ForTokensTag.java (working copy) >@@ -58,8 +58,8 @@ > validateStep(); > } > >- // stores the 'items' String we're passed >- public void setItems(String s) throws JspTagException { >+ // 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) >Index: src/org/apache/taglibs/standard/tag/common/sql/DataSourceWrapper.java >=================================================================== >--- src/org/apache/taglibs/standard/tag/common/sql/DataSourceWrapper.java (revision 655871) >+++ src/org/apache/taglibs/standard/tag/common/sql/DataSourceWrapper.java (working copy) >@@ -39,12 +39,24 @@ > private String password; > > public void setDriverClassName(String driverClassName) >- throws ClassNotFoundException, InstantiationException, >- IllegalAccessException { >+ throws ClassNotFoundException, InstantiationException, >+ IllegalAccessException { > >- this.driverClassName = driverClassName; >- Class.forName(driverClassName, true, >- Thread.currentThread().getContextClassLoader()).newInstance(); >+ this.driverClassName = driverClassName; >+ >+ //get the classloader >+ ClassLoader cl; >+ SecurityManager sm = System.getSecurityManager(); >+ if (sm == null) { >+ cl = Thread.currentThread().getContextClassLoader(); >+ } else { >+ cl = java.security.AccessController.doPrivileged( >+ new java.security.PrivilegedAction<ClassLoader>() >+ {public ClassLoader run() {return Thread.currentThread().getContextClassLoader();}}); >+ } >+ //done getting classloader >+ >+ Class.forName(driverClassName, true, cl).newInstance(); > } > > public void setJdbcURL(String jdbcURL) { >@@ -110,6 +122,13 @@ > 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")); >+ } > >+ public synchronized Object unwrap(Class c) throws SQLException { >+ throw new SQLException(Resources.getMessage("NOT_SUPPORTED")); >+ } > > } >Index: src/org/apache/taglibs/standard/tag/common/fmt/BundleSupport.java >=================================================================== >--- src/org/apache/taglibs/standard/tag/common/fmt/BundleSupport.java (revision 655871) >+++ src/org/apache/taglibs/standard/tag/common/fmt/BundleSupport.java (working copy) >@@ -200,8 +200,8 @@ > if (locCtxt == null) { > // try using the root resource bundle with the given basename > try { >- bundle = ResourceBundle.getBundle(basename, EMPTY_LOCALE, >- Thread.currentThread().getContextClassLoader()); >+ ClassLoader cl = getClassLoaderCheckingPrivilege(); >+ bundle = ResourceBundle.getBundle(basename, EMPTY_LOCALE, cl); > if (bundle != null) { > locCtxt = new LocalizationContext(bundle, null); > } >@@ -278,9 +278,8 @@ > ResourceBundle match = null; > > try { >- ResourceBundle bundle = >- ResourceBundle.getBundle(basename, pref, >- Thread.currentThread().getContextClassLoader()); >+ ClassLoader cl = getClassLoaderCheckingPrivilege(); >+ ResourceBundle bundle = ResourceBundle.getBundle(basename, pref, cl); > Locale avail = bundle.getLocale(); > if (pref.equals(avail)) { > // Exact match >@@ -325,4 +324,17 @@ > > return match; > } >+ >+ private static ClassLoader getClassLoaderCheckingPrivilege() { >+ ClassLoader cl; >+ SecurityManager sm = System.getSecurityManager(); >+ if (sm == null) { >+ cl = Thread.currentThread().getContextClassLoader(); >+ } else { >+ cl = java.security.AccessController.doPrivileged( >+ new java.security.PrivilegedAction<ClassLoader>() >+ {public ClassLoader run() {return Thread.currentThread().getContextClassLoader();}}); >+ } >+ return cl; >+ } > } >Index: src/org/apache/taglibs/standard/tag/common/core/ForEachSupport.java >=================================================================== >--- src/org/apache/taglibs/standard/tag/common/core/ForEachSupport.java (revision 655871) >+++ src/org/apache/taglibs/standard/tag/common/core/ForEachSupport.java (working copy) >@@ -23,7 +23,13 @@ > import java.util.Map; > import java.util.StringTokenizer; > >+import javax.el.ELContext; >+import javax.el.ValueExpression; >+import javax.el.VariableMapper; > import javax.servlet.jsp.JspTagException; >+import javax.servlet.jsp.jstl.core.IndexedValueExpression; >+import javax.servlet.jsp.jstl.core.IteratedExpression; >+import javax.servlet.jsp.jstl.core.IteratedValueExpression; > import javax.servlet.jsp.jstl.core.LoopTagSupport; > > import org.apache.taglibs.standard.resources.Resources; >@@ -108,7 +114,133 @@ > return i.next(); > } > } >+ >+ protected class DeferredForEachIterator implements ForEachIterator { > >+ private ValueExpression itemsValueExpression; >+ private IteratedExpression itemsValueIteratedExpression; >+ private int length = -1; >+ private int currentIndex = 0; >+ private boolean isIndexedValueExpression = false; >+ private boolean anIterator = false; >+ 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) { >+ return true; >+ } else { >+ return false; >+ } >+ } else { >+ if (length!=-1) { >+ //a Collection, Map, or StringTokenizer >+ if (currentIndex<length) { >+ return true; >+ } else { >+ return false; >+ } >+ } else { >+ if (anIterator) { >+ return myIterator.hasNext(); >+ } else if (anEnumeration) { >+ return myEnumeration.hasMoreElements(); >+ } else { >+ //don't know what this is >+ return false; >+ } >+ } >+ } >+ } >+ public Object next() throws JspTagException { >+ ValueExpression nextValue = null; >+ if (isIndexedValueExpression) { >+ nextValue = new IndexedValueExpression(itemsValueExpression, currentIndex); >+ currentIndex++; >+ } else { >+ if (itemsValueIteratedExpression==null) { >+ itemsValueIteratedExpression = new IteratedExpression(itemsValueExpression, getDelims()); >+ } >+ nextValue = new IteratedValueExpression(itemsValueIteratedExpression, currentIndex); >+ currentIndex++; >+ if (length!=-1) { >+ //a Collection, Map, or StringTokenizer >+ //nothing else needed >+ } else { >+ //need to increment these guys >+ if (anIterator) { >+ myIterator.next(); >+ } else if (anEnumeration) { >+ myEnumeration.nextElement(); >+ } >+ } >+ } >+ return nextValue; >+ } >+ private void determineLengthAndType() throws JspTagException { >+ ELContext myELContext = pageContext.getELContext(); >+ Object o = itemsValueExpression.getValue(myELContext); >+ if (o instanceof Object[]) { >+ length = ((Object[])o).length; >+ isIndexedValueExpression = true; >+ } else if (o instanceof boolean[]) { >+ length = ((boolean[])o).length; >+ isIndexedValueExpression = true; >+ } else if (o instanceof byte[]) { >+ length = ((byte[])o).length; >+ isIndexedValueExpression = true; >+ } else if (o instanceof char[]) { >+ length = ((char[])o).length; >+ isIndexedValueExpression = true; >+ } else if (o instanceof short[]) { >+ length = ((short[])o).length; >+ isIndexedValueExpression = true; >+ } else if (o instanceof int[]) { >+ length = ((int[])o).length; >+ isIndexedValueExpression = true; >+ } else if (o instanceof long[]) { >+ length = ((long[])o).length; >+ isIndexedValueExpression = true; >+ } else if (o instanceof float[]) { >+ length = ((float[])o).length; >+ isIndexedValueExpression = true; >+ } else if (o instanceof double[]) { >+ length = ((double[])o).length; >+ isIndexedValueExpression = true; >+ } else if (o instanceof Collection) { >+ 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; >+ } else if (o instanceof Enumeration) { >+ isIndexedValueExpression = false; >+ anEnumeration=true; >+ myEnumeration = (Enumeration)o; >+ } else if (o instanceof Map) { >+ length = ((Map)o).size(); >+ isIndexedValueExpression = false; >+ // >+ //else if (o instanceof ResultSet) >+ // items = toForEachIterator((ResultSet) o); >+ // >+ } else if (o instanceof String) { >+ StringTokenizer st = new StringTokenizer((String)o, ","); >+ length = st.countTokens(); >+ isIndexedValueExpression = false; >+ } else { >+ //What does this mean if we get here??? >+ length=0; >+ } >+ } >+ } > > //********************************************************************* > // ForEach-specifc state (protected) >@@ -133,8 +265,17 @@ > protected void prepare() throws JspTagException { > // produce the right sort of ForEachIterator > if (rawItems != null) { >- // extract an iterator over the 'items' we've got >- items = supportedTypeForEachIterator(rawItems); >+ if (rawItems instanceof ValueExpression) { >+ deferredExpression = (ValueExpression)rawItems; >+ ELContext myELContext = pageContext.getELContext(); >+ VariableMapper vm = myELContext.getVariableMapper(); >+ //String itemsName=deferredExpression.getExpressionString(); >+ //vm.setVariable(itemsName, deferredExpression); >+ items = toDeferredForEachIterator(deferredExpression); >+ } else { >+ // extract an iterator over the 'items' we've got >+ items = supportedTypeForEachIterator(rawItems); >+ } > } else { > // no 'items', so use 'begin' and 'end' > items = beginEndForEachIterator(); >@@ -164,6 +305,7 @@ > // Private generation methods for the ForEachIterators we produce > > /* 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 { > >@@ -249,6 +391,10 @@ > //********************************************************************* > // Private conversion methods to handle the various types we support > >+ 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 { >Index: src/org/apache/taglibs/standard/tag/common/core/ForTokensSupport.java >=================================================================== >--- src/org/apache/taglibs/standard/tag/common/core/ForTokensSupport.java (revision 655871) >+++ src/org/apache/taglibs/standard/tag/common/core/ForTokensSupport.java (working copy) >@@ -18,7 +18,12 @@ > > import java.util.StringTokenizer; > >+import javax.el.ELContext; >+import javax.el.ValueExpression; >+import javax.el.VariableMapper; > import javax.servlet.jsp.JspTagException; >+import javax.servlet.jsp.jstl.core.IteratedExpression; >+import javax.servlet.jsp.jstl.core.IteratedValueExpression; > import javax.servlet.jsp.jstl.core.LoopTagSupport; > > /** >@@ -49,9 +54,11 @@ > //********************************************************************* > // ForEachTokens-specific state (protected) > >- protected String items; // 'items' attribute >+ protected Object items; // 'items' attribute > protected String delims; // 'delims' attribute > protected StringTokenizer st; // digested tokenizer >+ protected int currentIndex = 0; >+ private IteratedExpression itemsValueIteratedExpression; > > > //********************************************************************* >@@ -63,7 +70,18 @@ > */ > > protected void prepare() throws JspTagException { >- st = new StringTokenizer(items, delims); >+ if (items instanceof ValueExpression) { >+ deferredExpression = (ValueExpression) items; >+ ELContext myELContext = pageContext.getELContext(); >+ Object originalValue = deferredExpression.getValue(myELContext); >+ if (originalValue instanceof String) { >+ st = new StringTokenizer((String)originalValue, delims); >+ } else { >+ throw new JspTagException(); >+ } >+ } else { >+ st = new StringTokenizer((String)items, delims); >+ } > } > > protected boolean hasNext() throws JspTagException { >@@ -71,7 +89,17 @@ > } > > protected Object next() throws JspTagException { >- return st.nextElement(); >+ if (deferredExpression!=null) { >+ st.nextElement(); >+ if (itemsValueIteratedExpression==null) { >+ itemsValueIteratedExpression = new IteratedExpression(deferredExpression, getDelims()); >+ } >+ ValueExpression nextValue = new IteratedValueExpression(itemsValueIteratedExpression, currentIndex); >+ currentIndex++; >+ return nextValue; >+ } else { >+ return st.nextElement(); >+ } > } > > >@@ -86,4 +114,11 @@ > st = null; > } > >+ /** >+ * Get the delimiter for string tokens. Used only for constructing >+ * the deferred expression for it. >+ */ >+ protected String getDelims() { >+ return delims; >+ } > } >Index: src/org/apache/taglibs/standard/tag/common/core/SetSupport.java >=================================================================== >--- src/org/apache/taglibs/standard/tag/common/core/SetSupport.java (revision 655871) >+++ src/org/apache/taglibs/standard/tag/common/core/SetSupport.java (working copy) >@@ -24,11 +24,13 @@ > import java.util.Map; > > import javax.servlet.jsp.JspException; >+import javax.servlet.jsp.JspFactory; > import javax.servlet.jsp.JspTagException; > import javax.servlet.jsp.PageContext; >-import javax.servlet.jsp.el.ELException; >-import javax.servlet.jsp.el.ExpressionEvaluator; >-import javax.servlet.jsp.el.VariableResolver; >+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; >@@ -87,36 +89,56 @@ > > // determine the value by... > if (value != null) { >- // ... reading our attribute >- result = value; >- } else if (valueSpecified) { >- // ... accepting an explicit null >- result = null; >- } else { >- // ... retrieving and trimming our body >- if (bodyContent == null || bodyContent.getString() == null) >- result = ""; >- else >- result = bodyContent.getString().trim(); >- } >+ // ... reading our attribute >+ result = value; >+ } else if (valueSpecified) { >+ // ... accepting an explicit null >+ result = null; >+ } else { >+ // ... retrieving and trimming our body >+ if (bodyContent == null || bodyContent.getString() == null) >+ result = ""; >+ else >+ result = bodyContent.getString().trim(); >+ } > >- // decide what to do with the result >- if (var != null) { >- >- /* >+ // decide what to do with the result >+ if (var != null) { >+ /* > * Store the result, letting an IllegalArgumentException > * propagate back if the scope is invalid (e.g., if an attempt > * is made to store something in the session without any >- * HttpSession existing). >+ * HttpSession existing). > */ >- if (result != null) { >- pageContext.setAttribute(var, result, scope); >- } else { >- if (scopeSpecified) >- pageContext.removeAttribute(var, scope); >- else >- pageContext.removeAttribute(var); >- } >+ ELContext myELContext = pageContext.getELContext(); >+ VariableMapper vm = myELContext.getVariableMapper(); >+ if (result != null) { >+ //check for instanceof valueExpression >+ if (result instanceof ValueExpression) { >+ if (scope!=PageContext.PAGE_SCOPE) { >+ throw new JspException("Incorrect scope for ValueExpression. PageScope is required."); >+ } >+ //set variable in var Mapper >+ vm.setVariable(var, (ValueExpression)result); >+ } else { >+ /* >+ //else if not valueExpression - make sure to remove it from the Var mapper >+ //if the scope is page, should I remove this? >+ if (vm.resolveVariable(var)!=null) { >+ vm.setVariable(var, null); >+ }*/ >+ pageContext.setAttribute(var, result, scope); >+ } >+ } else { >+ //make sure to remove it from the Var mapper >+ if (vm.resolveVariable(var)!=null) { >+ vm.setVariable(var, null); >+ } >+ if (scopeSpecified) >+ pageContext.removeAttribute(var, scope); >+ else >+ pageContext.removeAttribute(var); >+ } > > } else if (target != null) { > >@@ -147,7 +169,7 @@ > m.invoke(target, > new Object[] { > convertToExpectedType(result, m.getParameterTypes()[0])}); >- } catch (javax.servlet.jsp.el.ELException ex) { >+ } catch (javax.el.ELException ex) { > throw new JspTagException(ex); > } > } else { >@@ -183,15 +205,10 @@ > */ > private Object convertToExpectedType( final Object value, > Class expectedType ) >- throws javax.servlet.jsp.el.ELException { >- ExpressionEvaluator evaluator = pageContext.getExpressionEvaluator(); >- return evaluator.evaluate( "${result}", expectedType, >- new VariableResolver() { >- public Object resolveVariable( String pName ) >- throws ELException { >- return value; >- } >- }, null ); >+ throws javax.el.ELException { >+ JspFactory jspFactory = JspFactory.getDefaultFactory(); >+ ExpressionFactory expressionFactory = jspFactory.getJspApplicationContext(pageContext.getServletContext()).getExpressionFactory(); >+ return expressionFactory.coerceToType(value, expectedType); > } > > //********************************************************************* >Index: src/javax/servlet/jsp/jstl/tlv/ScriptFreeTLV.java >=================================================================== >--- src/javax/servlet/jsp/jstl/tlv/ScriptFreeTLV.java (revision 655871) >+++ src/javax/servlet/jsp/jstl/tlv/ScriptFreeTLV.java (working copy) >@@ -76,7 +76,7 @@ > * @param initParms a mapping from the names of the initialization parameters > * to their values, as specified in the TLD. > */ >- public void setInitParameters (Map initParms) { >+ public void setInitParameters (Map<java.lang.String, java.lang.Object> initParms) { > super.setInitParameters(initParms); > String declarationsParm = (String) initParms.get("allowDeclarations"); > String scriptletsParm = (String) initParms.get("allowScriptlets"); >Index: src/javax/servlet/jsp/jstl/core/IteratedExpression.java >=================================================================== >--- src/javax/servlet/jsp/jstl/core/IteratedExpression.java (revision 0) >+++ src/javax/servlet/jsp/jstl/core/IteratedExpression.java (revision 0) >@@ -0,0 +1,136 @@ >+/** >+ * Licensed to the Apache Software Foundation (ASF) under one >+ * or more contributor license agreements. See the NOTICE file >+ * distributed with this work for additional information >+ * regarding copyright ownership. The ASF licenses this file >+ * to you under the Apache License, Version 2.0 (the >+ * "License"); you may not use this file except in compliance >+ * with the License. You may obtain a copy of the License at >+ * >+ * http://www.apache.org/licenses/LICENSE-2.0 >+ * >+ * Unless required by applicable law or agreed to in writing, >+ * software distributed under the License is distributed on an >+ * "AS IS" BASIS, 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 javax.servlet.jsp.jstl.core; >+ >+import java.util.Collection; >+import java.util.Enumeration; >+import java.util.Iterator; >+import java.util.Map; >+import java.util.Set; >+import java.util.StringTokenizer; >+import java.util.Vector; >+ >+import javax.el.ELContext; >+import javax.el.ValueExpression; >+ >+public final class IteratedExpression { >+ protected final ValueExpression orig; >+ protected final String delims; >+ private Object originalListObject = null; >+ private Iterator currentListObject = null; >+ private int currentIndex=0; >+ private enum TypesEnum {Undefined, ACollection, AnIterator, AnEnumeration, AMap, AString}; >+ private TypesEnum type = TypesEnum.Undefined; >+ >+ public IteratedExpression(ValueExpression valueExpression, String stringTokenSeparator) { >+ orig = valueExpression; >+ delims = stringTokenSeparator; >+ } >+ >+ public Object getItem(ELContext context, int i) { >+ if (originalListObject == null) { >+ originalListObject = orig.getValue(context); >+ if (originalListObject instanceof Collection){ >+ type=TypesEnum.ACollection; >+ } else if (originalListObject instanceof Iterator) { >+ type=TypesEnum.AnIterator; >+ } else if (originalListObject instanceof Enumeration) { >+ type=TypesEnum.AnEnumeration; >+ } else if (originalListObject instanceof Map) { >+ type=TypesEnum.AMap; >+ } else if (originalListObject instanceof String) { //StringTokens >+ type=TypesEnum.AString; >+ } else { >+ //it's of some other type ... should never get here >+ throw new RuntimeException("IteratedExpression.getItem: Object not of correct type."); >+ } >+ currentListObject = returnNewIterator(originalListObject, type); >+ } >+ Object currentObject=null; >+ if (i<currentIndex) { >+ currentListObject = returnNewIterator(originalListObject, type); >+ currentIndex = 0; >+ } >+ for (;currentIndex<=i;currentIndex++) { >+ if (currentListObject.hasNext()) { >+ currentObject= currentListObject.next(); >+ } else { >+ throw new RuntimeException("IteratedExpression.getItem: Index out of Bounds"); >+ } >+ } >+ return currentObject; >+ } >+ >+ public ValueExpression getValueExpression() { >+ return orig; >+ } >+ >+ private Iterator returnNewIterator(Object o, TypesEnum type) { >+ Iterator i = null; >+ switch (type) { >+ case ACollection: >+ i = ((Collection)o).iterator(); >+ break; >+ case AnIterator: >+ if (currentListObject==null) { >+ //first time through ... need to create Vector for originalListObject >+ Vector v = new Vector(); >+ Iterator myI = (Iterator)o; >+ while (myI.hasNext()) { >+ v.add(myI.next()); >+ } >+ originalListObject = v; >+ } >+ i = ((Vector)originalListObject).iterator(); >+ break; >+ case AnEnumeration: >+ if (currentListObject==null) { >+ //first time through ... need to create Vector for originalListObject >+ Vector v = new Vector(); >+ Enumeration myE = (Enumeration)o; >+ while (myE.hasMoreElements()) { >+ v.add(myE.nextElement()); >+ } >+ originalListObject = v; >+ } >+ i = ((Vector)originalListObject).iterator(); >+ break; >+ case AMap: >+ Set s = ((Map)o).entrySet(); >+ i = s.iterator(); >+ break; >+ case AString: >+ if (currentListObject==null) { >+ //first time through ... need to create Vector for originalListObject >+ Vector v = new Vector(); >+ StringTokenizer st = new StringTokenizer((String)o, delims); >+ while (st.hasMoreElements()) { >+ v.add(st.nextElement()); >+ } >+ originalListObject = v; >+ } >+ i = ((Vector)originalListObject).iterator(); >+ break; >+ default: //do Nothing ... this is not possible >+ break; >+ } >+ return i; >+ } >+} >\ No newline at end of file >Index: src/javax/servlet/jsp/jstl/core/LoopTagSupport.java >=================================================================== >--- src/javax/servlet/jsp/jstl/core/LoopTagSupport.java (revision 655871) >+++ src/javax/servlet/jsp/jstl/core/LoopTagSupport.java (working copy) >@@ -16,6 +16,9 @@ > > package javax.servlet.jsp.jstl.core; > >+import javax.el.ELContext; >+import javax.el.ValueExpression; >+import javax.el.VariableMapper; > import javax.servlet.jsp.JspException; > import javax.servlet.jsp.JspTagException; > import javax.servlet.jsp.PageContext; >@@ -104,6 +107,7 @@ > /** Attribute-exposing control */ > protected String itemId, statusId; > >+ protected ValueExpression deferredExpression=null; > > //********************************************************************* > // 'Private' state (implementation details) >@@ -500,28 +504,33 @@ > */ > private void exposeVariables() throws JspTagException { > >- /* >- * We need to support null items returned from next(); we >- * do this simply by passing such non-items through to the >- * scoped variable as effectively 'null' (that is, by calling >- * removeAttribute()). >- * >- * Also, just to be defensive, we handle the case of a null >- * 'status' object as well. >- * >- * We call getCurrent() and getLoopStatus() (instead of just using >- * 'item' and 'status') to bridge to subclasses correctly. >- * A subclass can override getCurrent() or getLoopStatus() but still >- * depend on our doStartTag() and doAfterBody(), which call this >- * method (exposeVariables()), to expose 'item' and 'status' >- * correctly. >- */ >- >- if (itemId != null) { >- if (getCurrent() == null) >- pageContext.removeAttribute(itemId, PageContext.PAGE_SCOPE); >- else >- pageContext.setAttribute(itemId, getCurrent()); >+ if (deferredExpression==null) { >+ /* >+ * We need to support null items returned from next(); we >+ * do this simply by passing such non-items through to the >+ * scoped variable as effectively 'null' (that is, by calling >+ * removeAttribute()). >+ * >+ * Also, just to be defensive, we handle the case of a null >+ * 'status' object as well. >+ * >+ * We call getCurrent() and getLoopStatus() (instead of just using >+ * 'item' and 'status') to bridge to subclasses correctly. >+ * A subclass can override getCurrent() or getLoopStatus() but still >+ * depend on our doStartTag() and doAfterBody(), which call this >+ * method (exposeVariables()), to expose 'item' and 'status' >+ * correctly. >+ */ >+ if (itemId != null) { >+ if (getCurrent() == null) >+ pageContext.removeAttribute(itemId, PageContext.PAGE_SCOPE); >+ else >+ pageContext.setAttribute(itemId, getCurrent()); >+ } >+ } else { //this is using a DeferredExpression >+ ELContext myELContext = pageContext.getELContext(); >+ VariableMapper vm = myELContext.getVariableMapper(); >+ vm.setVariable(itemId, (ValueExpression)getCurrent()); > } > if (statusId != null) { > if (getLoopStatus() == null) >@@ -537,9 +546,16 @@ > * restores them to their prior values (and scopes). > */ > private void unExposeVariables() { >- // "nested" variables are now simply removed >- if (itemId != null) >- pageContext.removeAttribute(itemId, PageContext.PAGE_SCOPE); >+ if (deferredExpression==null) { >+ // "nested" variables are now simply removed >+ if (itemId != null) >+ pageContext.removeAttribute(itemId, PageContext.PAGE_SCOPE); >+ } else { >+ //we're deferred ... remove variable mapping >+ ELContext myELContext = pageContext.getELContext(); >+ VariableMapper vm = myELContext.getVariableMapper(); >+ vm.setVariable(itemId, null); >+ } > if (statusId != null) > pageContext.removeAttribute(statusId, PageContext.PAGE_SCOPE); > } >@@ -589,4 +605,11 @@ > private boolean atEnd() { > return ((end != -1) && (begin + index >= end)); > } >+ /** >+ * Get the delimiter for string tokens. Used only for constructing >+ * the deferred expression for it. >+ */ >+ protected String getDelims() { >+ return ","; >+ } > } >Index: src/javax/servlet/jsp/jstl/core/IndexedValueExpression.java >=================================================================== >--- src/javax/servlet/jsp/jstl/core/IndexedValueExpression.java (revision 0) >+++ src/javax/servlet/jsp/jstl/core/IndexedValueExpression.java (revision 0) >@@ -0,0 +1,80 @@ >+/** >+ * Licensed to the Apache Software Foundation (ASF) under one >+ * or more contributor license agreements. See the NOTICE file >+ * distributed with this work for additional information >+ * regarding copyright ownership. The ASF licenses this file >+ * to you under the Apache License, Version 2.0 (the >+ * "License"); you may not use this file except in compliance >+ * with the License. You may obtain a copy of the License at >+ * >+ * http://www.apache.org/licenses/LICENSE-2.0 >+ * >+ * Unless required by applicable law or agreed to in writing, >+ * software distributed under the License is distributed on an >+ * "AS IS" BASIS, 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 javax.servlet.jsp.jstl.core; >+ >+import java.io.Serializable; >+ >+import javax.el.ELContext; >+import javax.el.ValueExpression; >+ >+public final class IndexedValueExpression extends ValueExpression implements Serializable { >+ >+ private static final long serialVersionUID = -7300711701036452952L; >+ protected final Integer i; >+ protected final ValueExpression orig; >+ >+ public IndexedValueExpression(ValueExpression valueExpression, int _i) { >+ orig = valueExpression; >+ i=_i; >+ } >+ >+ public boolean equals(Object arg0) { >+ boolean rc=false; >+ if (arg0!=null) { >+ if (arg0.equals(orig)) { >+ rc = true; >+ } >+ } >+ return rc; >+ } >+ >+ public Class getExpectedType() { >+ return orig.getExpectedType(); >+ } >+ >+ public String getExpressionString() { >+ return orig.getExpressionString(); >+ } >+ >+ public Class getType(ELContext elContext) { >+ return elContext.getELResolver().getType(elContext, orig.getValue(elContext), i); >+ } >+ >+ public Object getValue(ELContext elContext) { >+ return elContext.getELResolver().getValue(elContext, orig.getValue(elContext), i); >+ } >+ >+ public int hashCode() { >+ return orig.hashCode()+i; >+ } >+ >+ public boolean isLiteralText() { >+ return false; >+ } >+ >+ public boolean isReadOnly(ELContext elContext) { >+ return elContext.getELResolver().isReadOnly(elContext, orig.getValue(elContext), i); >+ } >+ >+ public void setValue(ELContext elContext, Object arg1) { >+ elContext.getELResolver().setValue(elContext, orig.getValue(elContext), i, arg1); >+ } >+ >+} >Index: src/javax/servlet/jsp/jstl/core/IteratedValueExpression.java >=================================================================== >--- src/javax/servlet/jsp/jstl/core/IteratedValueExpression.java (revision 0) >+++ src/javax/servlet/jsp/jstl/core/IteratedValueExpression.java (revision 0) >@@ -0,0 +1,78 @@ >+/** >+ * Licensed to the Apache Software Foundation (ASF) under one >+ * or more contributor license agreements. See the NOTICE file >+ * distributed with this work for additional information >+ * regarding copyright ownership. The ASF licenses this file >+ * to you under the Apache License, Version 2.0 (the >+ * "License"); you may not use this file except in compliance >+ * with the License. You may obtain a copy of the License at >+ * >+ * http://www.apache.org/licenses/LICENSE-2.0 >+ * >+ * Unless required by applicable law or agreed to in writing, >+ * software distributed under the License is distributed on an >+ * "AS IS" BASIS, 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 javax.servlet.jsp.jstl.core; >+ >+import javax.el.ELContext; >+import javax.el.ValueExpression; >+ >+public final class IteratedValueExpression extends ValueExpression { >+ >+ private static final long serialVersionUID = 2771035360633553883L; >+ //IteratedExpression is not serializable >+ protected final IteratedExpression iteratedExpression; >+ protected final int i; >+ >+ public IteratedValueExpression(IteratedExpression _iteratedExpression, int _i) { >+ iteratedExpression = _iteratedExpression; >+ i = _i; >+ } >+ >+ public boolean equals(Object arg0) { >+ if (arg0==null) { >+ return false; >+ } >+ if (iteratedExpression.getValueExpression().equals(arg0)) { >+ return true; >+ } >+ return false; >+ } >+ >+ public Class getExpectedType() { >+ return iteratedExpression.getValueExpression().getExpectedType(); >+ } >+ >+ public String getExpressionString() { >+ return iteratedExpression.getValueExpression().getExpressionString(); >+ } >+ >+ public Class getType(ELContext elContext) { >+ return iteratedExpression.getValueExpression().getType(elContext); >+ } >+ >+ public Object getValue(ELContext elContext) { >+ return iteratedExpression.getItem(elContext, i); >+ } >+ >+ public int hashCode() { >+ return iteratedExpression.hashCode()+i; >+ } >+ >+ public boolean isLiteralText() { >+ return false; >+ } >+ >+ public boolean isReadOnly(ELContext elContext) { >+ return true; >+ } >+ >+ public void setValue(ELContext elContext, Object arg1) { >+ } >+ >+}
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 45197
: 22121 |
23032