JBossWeb SVN: r1260 - tags.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-11-10 12:11:41 -0500 (Tue, 10 Nov 2009)
New Revision: 1260
Added:
tags/JBOSSWEB_3_0_0_ALPHA17/
Log:
- EL and JSP fixes.
Copied: tags/JBOSSWEB_3_0_0_ALPHA17 (from rev 1259, trunk)
15 years, 1 month
JBossWeb SVN: r1259 - trunk.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-11-10 12:10:43 -0500 (Tue, 10 Nov 2009)
New Revision: 1259
Removed:
trunk/ROADMAP.txt
Log:
- Remove roadmap.
Deleted: trunk/ROADMAP.txt
===================================================================
--- trunk/ROADMAP.txt 2009-11-10 01:01:04 UTC (rev 1258)
+++ trunk/ROADMAP.txt 2009-11-10 17:10:43 UTC (rev 1259)
@@ -1,22 +0,0 @@
-Roadmap for JBoss Web 3.0
-
-Standalone:
-- Enforce web.xml fragments merging rules
-- Lazy webapp startup valve
-- JMX abstraction: redo MapperListener with regular listeners, and abstract JMX in modeler
-- JSP 2.2 changes
-- EL 1.1 changes
-
-JBoss AS:
-- JBoss Metadata parsing of .tld files (out of tree)
-- Coordinate with AS 6 to implement new web.xml parsing (out of tree)
-- Coordinate with AS 6 for annotation updates (out of tree)
-
-Other:
-- Setup standalone TCK environment for testing compliance with the new features
-- Diagnostic and monitoring features (provided by the jopr/JON agent, as JBoss Web standalone seems too
- lightweight for embedded jopr/JON to make sense)
-- .net support like the php support (looks ok, but PHP is hard to use, how would this be different ?)
-- fastcgi servlet (sounds useless)
-- Java proxy (probably too many components needed to compete with mod_cluster, but a very basic HTTP proxy could be useful
- for the rewrite valve)
15 years, 1 month
JBossWeb SVN: r1258 - trunk/java/org/apache/jasper/compiler.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-11-09 20:01:04 -0500 (Mon, 09 Nov 2009)
New Revision: 1258
Modified:
trunk/java/org/apache/jasper/compiler/Compiler.java
trunk/java/org/apache/jasper/compiler/JspConfig.java
trunk/java/org/apache/jasper/compiler/PageInfo.java
Log:
- Add the three new jsp-property-group elements.
Modified: trunk/java/org/apache/jasper/compiler/Compiler.java
===================================================================
--- trunk/java/org/apache/jasper/compiler/Compiler.java 2009-11-09 15:24:30 UTC (rev 1257)
+++ trunk/java/org/apache/jasper/compiler/Compiler.java 2009-11-10 01:01:04 UTC (rev 1258)
@@ -139,6 +139,16 @@
pageInfo.setTrimDirectiveWhitespaces(JspUtil.booleanValue(jspProperty
.isTrimDirectiveWhitespaces()));
}
+ if (jspProperty.getDefaultContentType() != null && pageInfo.getContentType() == null) {
+ pageInfo.setContentType(jspProperty.getDefaultContentType());
+ }
+ if (jspProperty.getBuffer() != null && pageInfo.getBufferValue() == null) {
+ pageInfo.setBufferValue(jspProperty.getBuffer(), errDispatcher);
+ }
+ if (jspProperty.isErrorOnUndeclaredNamespace() != null) {
+ pageInfo.setErrorOnUndeclaredNamespace(JspUtil.booleanValue(jspProperty
+ .isErrorOnUndeclaredNamespace()));
+ }
ctxt.checkOutputDir();
String javaFileName = ctxt.getServletJavaFileName();
Modified: trunk/java/org/apache/jasper/compiler/JspConfig.java
===================================================================
--- trunk/java/org/apache/jasper/compiler/JspConfig.java 2009-11-09 15:24:30 UTC (rev 1257)
+++ trunk/java/org/apache/jasper/compiler/JspConfig.java 2009-11-10 01:01:04 UTC (rev 1258)
@@ -46,8 +46,6 @@
package org.apache.jasper.compiler;
-import java.io.InputStream;
-import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
@@ -56,10 +54,7 @@
import org.apache.catalina.Globals;
import org.apache.jasper.JasperException;
-import org.apache.jasper.xmlparser.ParserUtils;
-import org.apache.jasper.xmlparser.TreeNode;
import org.jboss.logging.Logger;
-import org.xml.sax.InputSource;
/**
* Handles the jsp-config element in WEB_INF/web.xml. This is used
@@ -84,6 +79,9 @@
private String defaultDeferedSyntaxAllowedAsLiteral = null;
private String defaultTrimDirectiveWhitespaces = null;
private JspProperty defaultJspProperty;
+ private String defaultDefaultContentType = null;
+ private String defaultBuffer = null;
+ private String defaultErrorOnUndeclaredNamespace = null;
public JspConfig(ServletContext ctxt) {
this.ctxt = ctxt;
@@ -161,7 +159,10 @@
jspPropertyGroup.getIncludePreludes(),
jspPropertyGroup.getIncludeCodas(),
jspPropertyGroup.getDeferredSyntaxAllowedAsLiteral(),
- jspPropertyGroup.getTrimDirectiveWhitespaces());
+ jspPropertyGroup.getTrimDirectiveWhitespaces(),
+ jspPropertyGroup.getDefaultContentType(),
+ jspPropertyGroup.getBuffer(),
+ jspPropertyGroup.getErrorOnUndeclaredNamespace());
JspPropertyGroup propertyGroup =
new JspPropertyGroup(path, extension, property);
@@ -173,7 +174,8 @@
defaultIsELIgnored,
defaultIsScriptingInvalid,
null, null, null, defaultDeferedSyntaxAllowedAsLiteral,
- defaultTrimDirectiveWhitespaces);
+ defaultTrimDirectiveWhitespaces, defaultDefaultContentType,
+ defaultBuffer, defaultErrorOnUndeclaredNamespace);
initialized = true;
}
}
@@ -251,6 +253,9 @@
JspPropertyGroup pageEncodingMatch = null;
JspPropertyGroup deferedSyntaxAllowedAsLiteralMatch = null;
JspPropertyGroup trimDirectiveWhitespacesMatch = null;
+ JspPropertyGroup defaultContentTypeMatch = null;
+ JspPropertyGroup bufferMatch = null;
+ JspPropertyGroup errorOnUndeclaredNamespaceMatch = null;
Iterator<JspPropertyGroup> iter = jspProperties.iterator();
while (iter.hasNext()) {
@@ -313,15 +318,28 @@
trimDirectiveWhitespacesMatch =
selectProperty(trimDirectiveWhitespacesMatch, jpg);
}
+ if (jp.getDefaultContentType() != null) {
+ defaultContentTypeMatch =
+ selectProperty(defaultContentTypeMatch, jpg);
+ }
+ if (jp.getBuffer() != null) {
+ bufferMatch = selectProperty(bufferMatch, jpg);
+ }
+ if (jp.isErrorOnUndeclaredNamespace() != null) {
+ errorOnUndeclaredNamespaceMatch =
+ selectProperty(errorOnUndeclaredNamespaceMatch, jpg);
+ }
}
-
String isXml = defaultIsXml;
String isELIgnored = defaultIsELIgnored;
String isScriptingInvalid = defaultIsScriptingInvalid;
String pageEncoding = null;
String isDeferedSyntaxAllowedAsLiteral = defaultDeferedSyntaxAllowedAsLiteral;
String isTrimDirectiveWhitespaces = defaultTrimDirectiveWhitespaces;
+ String defaultContentType = defaultDefaultContentType;
+ String buffer = defaultBuffer;
+ String isErrorOnUnderclaredNamespace = defaultErrorOnUndeclaredNamespace;
if (isXmlMatch != null) {
isXml = isXmlMatch.getJspProperty().isXml();
@@ -344,10 +362,22 @@
isTrimDirectiveWhitespaces =
trimDirectiveWhitespacesMatch.getJspProperty().isTrimDirectiveWhitespaces();
}
+ if (defaultContentTypeMatch != null) {
+ defaultContentType =
+ defaultContentTypeMatch.getJspProperty().getDefaultContentType();
+ }
+ if (bufferMatch != null) {
+ buffer = bufferMatch.getJspProperty().getBuffer();
+ }
+ if (errorOnUndeclaredNamespaceMatch != null) {
+ isErrorOnUnderclaredNamespace =
+ errorOnUndeclaredNamespaceMatch.getJspProperty().isErrorOnUndeclaredNamespace();
+ }
return new JspProperty(isXml, isELIgnored, isScriptingInvalid,
pageEncoding, includePreludes, includeCodas,
- isDeferedSyntaxAllowedAsLiteral, isTrimDirectiveWhitespaces);
+ isDeferedSyntaxAllowedAsLiteral, isTrimDirectiveWhitespaces,
+ defaultContentType, buffer, isErrorOnUnderclaredNamespace);
}
/**
@@ -432,12 +462,16 @@
private ArrayList<String> includeCoda;
private String deferedSyntaxAllowedAsLiteral;
private String trimDirectiveWhitespaces;
+ private String defaultContentType;
+ private String buffer;
+ private String errorOnUndeclaredNamespace;
public JspProperty(String isXml, String elIgnored,
String scriptingInvalid, String pageEncoding,
ArrayList<String> includePrelude, ArrayList<String> includeCoda,
String deferedSyntaxAllowedAsLiteral,
- String trimDirectiveWhitespaces) {
+ String trimDirectiveWhitespaces, String defaultContentType,
+ String buffer, String errorOnUndeclaredNamespace) {
this.isXml = isXml;
this.elIgnored = elIgnored;
@@ -447,6 +481,9 @@
this.includeCoda = includeCoda;
this.deferedSyntaxAllowedAsLiteral = deferedSyntaxAllowedAsLiteral;
this.trimDirectiveWhitespaces = trimDirectiveWhitespaces;
+ this.defaultContentType = defaultContentType;
+ this.buffer = buffer;
+ this.errorOnUndeclaredNamespace = errorOnUndeclaredNamespace;
}
public String isXml() {
@@ -480,5 +517,17 @@
public String isTrimDirectiveWhitespaces() {
return trimDirectiveWhitespaces;
}
+
+ public String getDefaultContentType() {
+ return defaultContentType;
+ }
+
+ public String getBuffer() {
+ return buffer;
+ }
+
+ public String isErrorOnUndeclaredNamespace() {
+ return errorOnUndeclaredNamespace;
+ }
}
}
Modified: trunk/java/org/apache/jasper/compiler/PageInfo.java
===================================================================
--- trunk/java/org/apache/jasper/compiler/PageInfo.java 2009-11-09 15:24:30 UTC (rev 1257)
+++ trunk/java/org/apache/jasper/compiler/PageInfo.java 2009-11-10 01:01:04 UTC (rev 1258)
@@ -81,6 +81,9 @@
private String trimDirectiveWhitespacesValue;
private boolean trimDirectiveWhitespaces = false;
+ // JSP 2.2
+ private boolean isErrorOnUndeclaredNamespace = false;
+
private String omitXmlDecl = null;
private String doctypeName = null;
private String doctypePublic = null;
@@ -469,6 +472,25 @@
bufferValue = value;
}
+ public void setBufferValue(String value, ErrorDispatcher err)
+ throws JasperException {
+
+ if ("none".equalsIgnoreCase(value))
+ buffer = 0;
+ else {
+ if (value == null || !value.endsWith("kb"))
+ err.jspError("jsp.error.page.invalid.buffer");
+ try {
+ Integer k = new Integer(value.substring(0, value.length()-2));
+ buffer = k.intValue() * 1024;
+ } catch (NumberFormatException e) {
+ err.jspError("jsp.error.page.invalid.buffer");
+ }
+ }
+
+ bufferValue = value;
+ }
+
public String getBufferValue() {
return bufferValue;
}
@@ -713,6 +735,14 @@
this.trimDirectiveWhitespaces = trimDirectiveWhitespaces;
}
+ public void setErrorOnUndeclaredNamespace(boolean s) {
+ isErrorOnUndeclaredNamespace = s;
+ }
+
+ public boolean isErrorOnUndeclaredNamespace() {
+ return isErrorOnUndeclaredNamespace;
+ }
+
public Set<String> getVarInfoNames() {
return varInfoNames;
}
15 years, 1 month
JBossWeb SVN: r1257 - trunk/java/org/apache/el.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-11-09 10:24:30 -0500 (Mon, 09 Nov 2009)
New Revision: 1257
Modified:
trunk/java/org/apache/el/ValueExpressionImpl.java
Log:
- Proper comparable representation.
Modified: trunk/java/org/apache/el/ValueExpressionImpl.java
===================================================================
--- trunk/java/org/apache/el/ValueExpressionImpl.java 2009-11-09 04:36:50 UTC (rev 1256)
+++ trunk/java/org/apache/el/ValueExpressionImpl.java 2009-11-09 15:24:30 UTC (rev 1257)
@@ -197,16 +197,22 @@
* @see java.lang.Object#hashCode()
*/
public int hashCode() {
- StringBuilder hash = new StringBuilder(getNode().toString());
- for (int i = 0; i < getNode().jjtGetNumChildren(); i++) {
- Node child = getNode().jjtGetChild(i);
- String childToString = child.toString();
- if (childToString != null) {
- hash.append('[').append(childToString).append(']');
- }
- }
+ StringBuilder hash = new StringBuilder();
+ comparableRepresentation(hash, getNode());
return hash.toString().hashCode();
}
+
+ private void comparableRepresentation(StringBuilder string, Node node) {
+ if (node.toString() != null) {
+ string.append(node.toString());
+ }
+ for (int i = 0; i < node.jjtGetNumChildren(); i++) {
+ Node child = node.jjtGetChild(i);
+ string.append('[');
+ comparableRepresentation(string, child);
+ string.append(']');
+ }
+ }
/*
* (non-Javadoc)
@@ -267,7 +273,6 @@
}
public ValueReference getValueReference(ELContext context) {
- System.out.println("Node: " + this.getNode() + " Image: " + this.getNode().getImage());
EvaluationContext ctx = new EvaluationContext(context, this.fnMapper,
this.varMapper);
return this.getNode().getValueReference(ctx);
15 years, 1 month
JBossWeb SVN: r1256 - in trunk/java/javax/servlet: http and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-11-08 23:36:50 -0500 (Sun, 08 Nov 2009)
New Revision: 1256
Modified:
trunk/java/javax/servlet/AsyncContext.java
trunk/java/javax/servlet/ServletContext.java
trunk/java/javax/servlet/http/Cookie.java
Log:
- Spec update.
Modified: trunk/java/javax/servlet/AsyncContext.java
===================================================================
--- trunk/java/javax/servlet/AsyncContext.java 2009-11-09 03:56:49 UTC (rev 1255)
+++ trunk/java/javax/servlet/AsyncContext.java 2009-11-09 04:36:50 UTC (rev 1256)
@@ -419,6 +419,11 @@
* <p>The given AsyncListener class must define a zero argument
* constructor, which is used to instantiate it.
*
+ * <p>This method supports resource injection if the given
+ * <tt>clazz</tt> represents a Managed Bean.
+ * See the Java EE platform and JSR 299 specifications for additional
+ * details about Managed Beans and resource injection.
+
* <p>This method supports any annotations applicable to AsyncListener.
*
* @param clazz the AsyncListener class to instantiate
Modified: trunk/java/javax/servlet/ServletContext.java
===================================================================
--- trunk/java/javax/servlet/ServletContext.java 2009-11-09 03:56:49 UTC (rev 1255)
+++ trunk/java/javax/servlet/ServletContext.java 2009-11-09 04:36:50 UTC (rev 1256)
@@ -748,10 +748,15 @@
* it will be completed (by assigning the given <tt>className</tt> to it)
* and returned.
*
- * <p>This method supports any annotations applicable to Servlets
- * that may have been specified on the class with the given
- * <tt>className</tt>, with the exception of
- * {@link javax.servlet.annotation.WebServlet}, which is ignored.
+ * <p>This method introspects the class with the given <tt>className</tt>
+ * for the {@link javax.servlet.annotation.ServletSecurity},
+ * {@link javax.servlet.annotation.MultipartConfig},
+ * <tt>javax.annotation.security.RunAs</tt>, and
+ * <tt>javax.annotation.security.DeclareRoles</tt> annotations.
+ * In addition, this method supports resource injection if the
+ * class with the given <tt>className</tt> represents a Managed Bean.
+ * See the Java EE platform and JSR 299 specifications for additional
+ * details about Managed Beans and resource injection.
*
* @param servletName the name of the servlet
* @param className the fully qualified class name of the servlet
@@ -828,10 +833,15 @@
* it will be completed (by assigning the name of the given
* <tt>servletClass</tt> to it) and returned.
*
- * <p>This method supports any annotations applicable to Servlets
- * that may have been specified on the given <tt>servletClass</tt>,
- * with the exception of {@link javax.servlet.annotation.WebServlet},
- * which is ignored.
+ * <p>This method introspects the given <tt>servletClass</tt> for
+ * the {@link javax.servlet.annotation.ServletSecurity},
+ * {@link javax.servlet.annotation.MultipartConfig},
+ * <tt>javax.annotation.security.RunAs</tt>, and
+ * <tt>javax.annotation.security.DeclareRoles</tt> annotations.
+ * In addition, this method supports resource injection if the
+ * given <tt>servletClass</tt> represents a Managed Bean.
+ * See the Java EE platform and JSR 299 specifications for additional
+ * details about Managed Beans and resource injection.
*
* @param servletName the name of the servlet
* @param servletClass the class object from which the servlet will be
@@ -867,10 +877,16 @@
* <p>The given Servlet class must define a zero argument constructor,
* which is used to instantiate it.
*
- * <p>This method supports any annotations applicable to Servlets
- * that may have been specified on the given <tt>clazz</tt>, with the
- * exception of {@link javax.servlet.annotation.WebServlet}, which
- * is ignored.
+ * <p>This method introspects the given <tt>clazz</tt> for
+ * the following annotations:
+ * {@link javax.servlet.annotation.ServletSecurity},
+ * {@link javax.servlet.annotation.MultipartConfig},
+ * <tt>javax.annotation.security.RunAs</tt>, and
+ * <tt>javax.annotation.security.DeclareRoles</tt>.
+ * In addition, this method supports resource injection if the
+ * given <tt>clazz</tt> represents a Managed Bean.
+ * See the Java EE platform and JSR 299 specifications for additional
+ * details about Managed Beans and resource injection.
*
* @param clazz the Servlet class to instantiate
*
@@ -953,10 +969,10 @@
* it will be completed (by assigning the given <tt>className</tt> to it)
* and returned.
*
- * <p>This method supports any annotations applicable to Filters
- * that may have been specified on the class with the given
- * <tt>className</tt>, with the exception of
- * {@link javax.servlet.annotation.WebFilter}, which is ignored.
+ * <p>This method supports resource injection if the class with the
+ * given <tt>className</tt> represents a Managed Bean.
+ * See the Java EE platform and JSR 299 specifications for additional
+ * details about Managed Beans and resource injection.
*
* @param filterName the name of the filter
* @param className the fully qualified class name of the filter
@@ -1030,10 +1046,10 @@
* it will be completed (by assigning the name of the given
* <tt>filterClass</tt> to it) and returned.
*
- * <p>This method supports any annotations applicable to Filters
- * that may have been specified on the given <tt>filterClass</tt>,
- * with the exception of {@link javax.servlet.annotation.WebFilter},
- * which is ignored.
+ * <p>This method supports resource injection if the given
+ * <tt>filterClass</tt> represents a Managed Bean.
+ * See the Java EE platform and JSR 299 specifications for additional
+ * details about Managed Beans and resource injection.
*
* @param filterName the name of the filter
* @param filterClass the class object from which the filter will be
@@ -1069,10 +1085,10 @@
* <p>The given Filter class must define a zero argument constructor,
* which is used to instantiate it.
*
- * <p>This method supports any annotations applicable to Filters
- * that may have been specified on the given <tt>clazz</tt>, with the
- * exception of {@link javax.servlet.annotation.WebFilter}, which is
- * ignored.
+ * <p>This method supports resource injection if the given
+ * <tt>clazz</tt> represents a Managed Bean.
+ * See the Java EE platform and JSR 299 specifications for additional
+ * details about Managed Beans and resource injection.
*
* @param clazz the Filter class to instantiate
*
@@ -1269,10 +1285,10 @@
* then the new listener will be added to the end of the ordered list of
* listeners of that interface.
*
- * <p>This method supports any annotations applicable to the above
- * types of listeners that may have been specified on the class with the
- * given <tt>className</tt>, with the exception of
- * {@link javax.servlet.annotation.WebListener}, which is ignored.
+ * <p>This method supports resource injection if the class with the
+ * given <tt>className</tt> represents a Managed Bean.
+ * See the Java EE platform and JSR 299 specifications for additional
+ * details about Managed Beans and resource injection.
*
* @param className the fully qualified class name of the listener
*
@@ -1369,10 +1385,10 @@
* then the new listener will be added to the end of the ordered list
* of listeners of that interface.
*
- * <p>This method supports any annotations applicable to the above
- * types of listeners that may have been specified on the given
- * <tt>listenerClass</tt>, with the exception of
- * {@link javax.servlet.annotation.WebListener}, which is ignored.
+ * <p>This method supports resource injection if the given
+ * <tt>listenerClass</tt> represents a Managed Bean.
+ * See the Java EE platform and JSR 299 specifications for additional
+ * details about Managed Beans and resource injection.
*
* @param listenerClass the listener class to be instantiated
*
@@ -1414,10 +1430,10 @@
* <p>The given EventListener class must define a zero argument
* constructor, which is used to instantiate it.
*
- * <p>This method supports any annotations applicable to the above
- * types of listeners that may have been specified on the given
- * <tt>clazz</tt>, with the exception of
- * {@link javax.servlet.annotation.WebListener}, which is ignored.
+ * <p>This method supports resource injection if the given
+ * <tt>clazz</tt> represents a Managed Bean.
+ * See the Java EE platform and JSR 299 specifications for additional
+ * details about Managed Beans and resource injection.
*
* @param clazz the EventListener class to instantiate
*
Modified: trunk/java/javax/servlet/http/Cookie.java
===================================================================
--- trunk/java/javax/servlet/http/Cookie.java 2009-11-09 03:56:49 UTC (rev 1255)
+++ trunk/java/javax/servlet/http/Cookie.java 2009-11-09 04:36:50 UTC (rev 1256)
@@ -96,10 +96,20 @@
*/
public class Cookie implements Cloneable, Serializable {
- private static final long serialVersionUID = -6454587001725327448L;
+ private static final long serialVersionUID = 4014436410614806011L;
- private static final String tspecials = "/()<>@,;:\\\"[]?={} \t";
+ public static final boolean STRICT =
+ Boolean.valueOf(System.getProperty("Cookie.STRICT", "false")).booleanValue();
+ private static final String tspecials;
+ static {
+ if (STRICT) {
+ tspecials = "/()<>@,;:\\\"[]?={} \t";
+ } else {
+ tspecials = ",; ";
+ }
+ }
+
private static final String LSTRING_FILE =
"javax.servlet.http.LocalStrings";
15 years, 1 month
JBossWeb SVN: r1255 - in trunk/java: org/apache/el and 2 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-11-08 22:56:49 -0500 (Sun, 08 Nov 2009)
New Revision: 1255
Modified:
trunk/java/javax/el/ValueReference.java
trunk/java/org/apache/el/ExpressionFactoryImpl.java
trunk/java/org/apache/el/ValueExpressionImpl.java
trunk/java/org/apache/el/lang/ELSupport.java
trunk/java/org/apache/el/parser/AstIdentifier.java
trunk/java/org/apache/el/parser/AstValue.java
trunk/java/org/apache/el/parser/Node.java
trunk/java/org/apache/el/parser/SimpleNode.java
Log:
- Various EL fixes.
Modified: trunk/java/javax/el/ValueReference.java
===================================================================
--- trunk/java/javax/el/ValueReference.java 2009-11-08 17:19:30 UTC (rev 1254)
+++ trunk/java/javax/el/ValueReference.java 2009-11-09 03:56:49 UTC (rev 1255)
@@ -13,7 +13,7 @@
private Object base;
private Object property;
- public ValueReference(Object base, Object porperty) {
+ public ValueReference(Object base, Object property) {
this.base = base;
this.property = property;
}
Modified: trunk/java/org/apache/el/ExpressionFactoryImpl.java
===================================================================
--- trunk/java/org/apache/el/ExpressionFactoryImpl.java 2009-11-08 17:19:30 UTC (rev 1254)
+++ trunk/java/org/apache/el/ExpressionFactoryImpl.java 2009-11-09 03:56:49 UTC (rev 1255)
@@ -42,7 +42,7 @@
super();
}
- public Object coerceToType(Object obj, Class type) {
+ public Object coerceToType(Object obj, Class<?> type) {
return ELSupport.coerceToType(obj, type);
}
@@ -59,7 +59,7 @@
}
public ValueExpression createValueExpression(ELContext context,
- String expression, Class expectedType) {
+ String expression, Class<?> expectedType) {
if (expectedType == null) {
throw new NullPointerException(MessageFactory
.get("error.value.expectedType"));
@@ -69,7 +69,7 @@
}
public ValueExpression createValueExpression(Object instance,
- Class expectedType) {
+ Class<?> expectedType) {
if (expectedType == null) {
throw new NullPointerException(MessageFactory
.get("error.value.expectedType"));
Modified: trunk/java/org/apache/el/ValueExpressionImpl.java
===================================================================
--- trunk/java/org/apache/el/ValueExpressionImpl.java 2009-11-08 17:19:30 UTC (rev 1254)
+++ trunk/java/org/apache/el/ValueExpressionImpl.java 2009-11-09 03:56:49 UTC (rev 1255)
@@ -31,6 +31,7 @@
import javax.el.PropertyNotFoundException;
import javax.el.PropertyNotWritableException;
import javax.el.ValueExpression;
+import javax.el.ValueReference;
import javax.el.VariableMapper;
import org.apache.el.lang.ELSupport;
@@ -196,7 +197,15 @@
* @see java.lang.Object#hashCode()
*/
public int hashCode() {
- return this.expr.hashCode();
+ StringBuilder hash = new StringBuilder(getNode().toString());
+ for (int i = 0; i < getNode().jjtGetNumChildren(); i++) {
+ Node child = getNode().jjtGetChild(i);
+ String childToString = child.toString();
+ if (childToString != null) {
+ hash.append('[').append(childToString).append(']');
+ }
+ }
+ return hash.toString().hashCode();
}
/*
@@ -257,6 +266,13 @@
out.writeObject(this.varMapper);
}
+ public ValueReference getValueReference(ELContext context) {
+ System.out.println("Node: " + this.getNode() + " Image: " + this.getNode().getImage());
+ EvaluationContext ctx = new EvaluationContext(context, this.fnMapper,
+ this.varMapper);
+ return this.getNode().getValueReference(ctx);
+ }
+
public String toString() {
return "ValueExpression["+this.expr+"]";
}
Modified: trunk/java/org/apache/el/lang/ELSupport.java
===================================================================
--- trunk/java/org/apache/el/lang/ELSupport.java 2009-11-08 17:19:30 UTC (rev 1254)
+++ trunk/java/org/apache/el/lang/ELSupport.java 2009-11-09 03:56:49 UTC (rev 1255)
@@ -143,14 +143,19 @@
* @param type
* @return
*/
- public final static Enum coerceToEnum(final Object obj, Class type) {
+ public final static Enum coerceToEnum(final Object obj, Class type)
+ throws ELException {
if (obj == null || "".equals(obj)) {
return null;
}
if (obj.getClass().isEnum()) {
return (Enum) obj;
}
- return Enum.valueOf(type, obj.toString());
+ try {
+ return Enum.valueOf(type, obj.toString());
+ } catch (Exception e) {
+ throw new ELException(e);
+ }
}
/**
@@ -158,7 +163,7 @@
* @return
*/
public final static Boolean coerceToBoolean(final Object obj)
- throws IllegalArgumentException {
+ throws ELException {
if (obj == null || "".equals(obj)) {
return Boolean.FALSE;
}
@@ -169,12 +174,12 @@
return Boolean.valueOf((String) obj);
}
- throw new IllegalArgumentException(MessageFactory.get("error.convert",
+ throw new ELException(MessageFactory.get("error.convert",
obj, obj.getClass(), Boolean.class));
}
public final static Character coerceToCharacter(final Object obj)
- throws IllegalArgumentException {
+ throws ELException {
if (obj == null || "".equals(obj)) {
return new Character((char) 0);
}
@@ -184,12 +189,12 @@
if (ELArithmetic.isNumber(obj)) {
return new Character((char) ((Number) obj).shortValue());
}
- Class objType = obj.getClass();
+ Class<?> objType = obj.getClass();
if (obj instanceof Character) {
return (Character) obj;
}
- throw new IllegalArgumentException(MessageFactory.get("error.convert",
+ throw new ELException(MessageFactory.get("error.convert",
obj, objType, Character.class));
}
@@ -209,7 +214,7 @@
}
protected final static Number coerceToNumber(final Number number,
- final Class type) throws IllegalArgumentException {
+ final Class<?> type) throws ELException {
if (Long.TYPE == type || Long.class.equals(type)) {
return new Long(number.longValue());
}
@@ -247,12 +252,12 @@
return new Float(number.floatValue());
}
- throw new IllegalArgumentException(MessageFactory.get("error.convert",
+ throw new ELException(MessageFactory.get("error.convert",
number, number.getClass(), type));
}
- public final static Number coerceToNumber(final Object obj, final Class type)
- throws IllegalArgumentException {
+ public final static Number coerceToNumber(final Object obj, final Class<?> type)
+ throws ELException {
if (obj == null || "".equals(obj)) {
return coerceToNumber(ZERO, type);
}
@@ -268,38 +273,43 @@
.charValue()), type);
}
- throw new IllegalArgumentException(MessageFactory.get("error.convert",
+ throw new ELException(MessageFactory.get("error.convert",
obj, obj.getClass(), type));
}
protected final static Number coerceToNumber(final String val,
- final Class type) throws IllegalArgumentException {
- if (Long.TYPE == type || Long.class.equals(type)) {
- return Long.valueOf(val);
+ final Class<?> type) throws ELException {
+ try {
+ if (Long.TYPE == type || Long.class.equals(type)) {
+ return Long.valueOf(val);
+ }
+ if (Integer.TYPE == type || Integer.class.equals(type)) {
+ return Integer.valueOf(val);
+ }
+ if (Double.TYPE == type || Double.class.equals(type)) {
+ return Double.valueOf(val);
+ }
+ if (BigInteger.class.equals(type)) {
+ return new BigInteger(val);
+ }
+ if (BigDecimal.class.equals(type)) {
+ return new BigDecimal(val);
+ }
+ if (Byte.TYPE == type || Byte.class.equals(type)) {
+ return Byte.valueOf(val);
+ }
+ if (Short.TYPE == type || Short.class.equals(type)) {
+ return Short.valueOf(val);
+ }
+ if (Float.TYPE == type || Float.class.equals(type)) {
+ return Float.valueOf(val);
+ }
+ } catch (Exception e) {
+ throw new ELException(MessageFactory.get("error.convert",
+ val, String.class, type), e);
}
- if (Integer.TYPE == type || Integer.class.equals(type)) {
- return Integer.valueOf(val);
- }
- if (Double.TYPE == type || Double.class.equals(type)) {
- return Double.valueOf(val);
- }
- if (BigInteger.class.equals(type)) {
- return new BigInteger(val);
- }
- if (BigDecimal.class.equals(type)) {
- return new BigDecimal(val);
- }
- if (Byte.TYPE == type || Byte.class.equals(type)) {
- return Byte.valueOf(val);
- }
- if (Short.TYPE == type || Short.class.equals(type)) {
- return Short.valueOf(val);
- }
- if (Float.TYPE == type || Float.class.equals(type)) {
- return Float.valueOf(val);
- }
- throw new IllegalArgumentException(MessageFactory.get("error.convert",
+ throw new ELException(MessageFactory.get("error.convert",
val, String.class, type));
}
@@ -319,8 +329,8 @@
}
}
- public final static void checkType(final Object obj, final Class type)
- throws IllegalArgumentException {
+ public final static void checkType(final Object obj, final Class<?> type)
+ throws ELException {
if (String.class.equals(type)) {
coerceToString(obj);
}
@@ -338,8 +348,8 @@
}
}
- public final static Object coerceToType(final Object obj, final Class type)
- throws IllegalArgumentException {
+ public final static Object coerceToType(final Object obj, final Class<?> type)
+ throws ELException {
if (type == null || Object.class.equals(type) ||
(obj != null && type.isAssignableFrom(obj.getClass()))) {
return obj;
@@ -372,7 +382,7 @@
return editor.getValue();
}
}
- throw new IllegalArgumentException(MessageFactory.get("error.convert",
+ throw new ELException(MessageFactory.get("error.convert",
obj, obj.getClass(), type));
}
Modified: trunk/java/org/apache/el/parser/AstIdentifier.java
===================================================================
--- trunk/java/org/apache/el/parser/AstIdentifier.java 2009-11-08 17:19:30 UTC (rev 1254)
+++ trunk/java/org/apache/el/parser/AstIdentifier.java 2009-11-09 03:56:49 UTC (rev 1255)
@@ -22,6 +22,7 @@
import javax.el.MethodExpression;
import javax.el.MethodInfo;
import javax.el.MethodNotFoundException;
+import javax.el.PropertyNotFoundException;
import javax.el.ValueExpression;
import javax.el.VariableMapper;
@@ -46,7 +47,12 @@
}
}
ctx.setPropertyResolved(false);
- return ctx.getELResolver().getType(ctx, null, this.image);
+ Class result = ctx.getELResolver().getType(ctx, null, this.image);
+ if (ctx.isPropertyResolved()) {
+ return result;
+ } else {
+ throw new PropertyNotFoundException("Could not resolve property '" + this.image + "'");
+ }
}
public Object getValue(EvaluationContext ctx) throws ELException {
@@ -58,7 +64,12 @@
}
}
ctx.setPropertyResolved(false);
- return ctx.getELResolver().getValue(ctx, null, this.image);
+ Object result = ctx.getELResolver().getValue(ctx, null, this.image);
+ if (ctx.isPropertyResolved()) {
+ return result;
+ } else {
+ throw new PropertyNotFoundException("Could not resolve property '" + this.image + "'");
+ }
}
public boolean isReadOnly(EvaluationContext ctx) throws ELException {
@@ -70,7 +81,12 @@
}
}
ctx.setPropertyResolved(false);
- return ctx.getELResolver().isReadOnly(ctx, null, this.image);
+ boolean result = ctx.getELResolver().isReadOnly(ctx, null, this.image);
+ if (ctx.isPropertyResolved()) {
+ return result;
+ } else {
+ throw new PropertyNotFoundException("Could not resolve property '" + this.image + "'");
+ }
}
public void setValue(EvaluationContext ctx, Object value)
@@ -85,6 +101,9 @@
}
ctx.setPropertyResolved(false);
ctx.getELResolver().setValue(ctx, null, this.image, value);
+ if (!ctx.isPropertyResolved()) {
+ throw new PropertyNotFoundException("Could not resolve property '" + this.image + "'");
+ }
}
private final Object invokeTarget(EvaluationContext ctx, Object target,
Modified: trunk/java/org/apache/el/parser/AstValue.java
===================================================================
--- trunk/java/org/apache/el/parser/AstValue.java 2009-11-08 17:19:30 UTC (rev 1254)
+++ trunk/java/org/apache/el/parser/AstValue.java 2009-11-09 03:56:49 UTC (rev 1255)
@@ -25,6 +25,7 @@
import javax.el.ELResolver;
import javax.el.MethodInfo;
import javax.el.PropertyNotFoundException;
+import javax.el.ValueReference;
import org.apache.el.lang.ELSupport;
import org.apache.el.lang.EvaluationContext;
@@ -58,6 +59,14 @@
return ctx.getELResolver().getType(ctx, t.base, t.property);
}
+ public ValueReference getValueReference(EvaluationContext ctx) {
+ try {
+ Target t = getTarget(ctx);
+ return new ValueReference(t.base, t.property);
+ } catch (Exception e) {
+ return null;
+ }
+ }
private final Target getTarget(EvaluationContext ctx) throws ELException {
// evaluate expr-a to value-a
Object base = this.children[0].getValue(ctx);
Modified: trunk/java/org/apache/el/parser/Node.java
===================================================================
--- trunk/java/org/apache/el/parser/Node.java 2009-11-08 17:19:30 UTC (rev 1254)
+++ trunk/java/org/apache/el/parser/Node.java 2009-11-09 03:56:49 UTC (rev 1255)
@@ -21,6 +21,7 @@
import javax.el.ELException;
import javax.el.MethodInfo;
+import javax.el.ValueReference;
import org.apache.el.lang.EvaluationContext;
@@ -62,6 +63,7 @@
public String getImage();
public Object getValue(EvaluationContext ctx) throws ELException;
+ public ValueReference getValueReference(EvaluationContext ctx);
public void setValue(EvaluationContext ctx, Object value) throws ELException;
public Class getType(EvaluationContext ctx) throws ELException;
public boolean isReadOnly(EvaluationContext ctx) throws ELException;
Modified: trunk/java/org/apache/el/parser/SimpleNode.java
===================================================================
--- trunk/java/org/apache/el/parser/SimpleNode.java 2009-11-08 17:19:30 UTC (rev 1254)
+++ trunk/java/org/apache/el/parser/SimpleNode.java 2009-11-09 03:56:49 UTC (rev 1255)
@@ -21,6 +21,7 @@
import javax.el.ELException;
import javax.el.MethodInfo;
import javax.el.PropertyNotWritableException;
+import javax.el.ValueReference;
import org.apache.el.lang.ELSupport;
import org.apache.el.lang.EvaluationContext;
@@ -131,6 +132,10 @@
throw new UnsupportedOperationException();
}
+ public ValueReference getValueReference(EvaluationContext ctx) {
+ return null;
+ }
+
public boolean isReadOnly(EvaluationContext ctx)
throws ELException {
return true;
15 years, 1 month
JBossWeb SVN: r1254 - tags.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-11-08 12:19:30 -0500 (Sun, 08 Nov 2009)
New Revision: 1254
Added:
tags/JBOSSWEB_3_0_0_ALPHA16/
Log:
- New build with fixes.
Copied: tags/JBOSSWEB_3_0_0_ALPHA16 (from rev 1253, trunk)
15 years, 1 month
JBossWeb SVN: r1253 - in trunk/java/org/apache/naming: resources and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-11-08 12:11:18 -0500 (Sun, 08 Nov 2009)
New Revision: 1253
Added:
trunk/java/org/apache/naming/NamingEnumerationImpl.java
Modified:
trunk/java/org/apache/naming/resources/ProxyDirContext.java
Log:
- Fix type oops when merging the enums.
Added: trunk/java/org/apache/naming/NamingEnumerationImpl.java
===================================================================
--- trunk/java/org/apache/naming/NamingEnumerationImpl.java (rev 0)
+++ trunk/java/org/apache/naming/NamingEnumerationImpl.java 2009-11-08 17:11:18 UTC (rev 1253)
@@ -0,0 +1,95 @@
+/*
+ * 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 org.apache.naming;
+
+import java.util.Collection;
+import java.util.Iterator;
+
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+
+/**
+ * Naming enumeration implementation.
+ *
+ * @author Remy Maucherat
+ * @version $Revision: 515 $ $Date: 2008-03-17 22:02:23 +0100 (Mon, 17 Mar 2008) $
+ */
+
+public class NamingEnumerationImpl<T>
+ implements NamingEnumeration<T> {
+
+
+ // ----------------------------------------------------------- Constructors
+
+
+ public NamingEnumerationImpl(Collection<T> entries) {
+ this.iterator = entries.iterator();
+ }
+
+
+ // -------------------------------------------------------------- Variables
+
+
+ /**
+ * Underlying collection.
+ */
+ protected Iterator<T> iterator;
+
+
+ // --------------------------------------------------------- Public Methods
+
+
+ /**
+ * Retrieves the next element in the enumeration.
+ */
+ public T next()
+ throws NamingException {
+ return nextElement();
+ }
+
+
+ /**
+ * Determines whether there are any more elements in the enumeration.
+ */
+ public boolean hasMore()
+ throws NamingException {
+ return iterator.hasNext();
+ }
+
+
+ /**
+ * Closes this enumeration.
+ */
+ public void close()
+ throws NamingException {
+ }
+
+
+ public boolean hasMoreElements() {
+ return iterator.hasNext();
+ }
+
+
+ public T nextElement() {
+ return iterator.next();
+ }
+
+
+}
+
Modified: trunk/java/org/apache/naming/resources/ProxyDirContext.java
===================================================================
--- trunk/java/org/apache/naming/resources/ProxyDirContext.java 2009-11-07 01:30:50 UTC (rev 1252)
+++ trunk/java/org/apache/naming/resources/ProxyDirContext.java 2009-11-08 17:11:18 UTC (rev 1253)
@@ -75,6 +75,7 @@
import org.apache.naming.NamingContextBindingsEnumeration;
import org.apache.naming.NamingContextEnumeration;
+import org.apache.naming.NamingEnumerationImpl;
import org.apache.naming.StringManager;
/**
@@ -540,7 +541,7 @@
if (main == null && merged == null) {
throw notFound;
} else if (merged != null) {
- return new NamingContextEnumeration(merged.values().iterator());
+ return new NamingEnumerationImpl<NameClassPair>(merged.values());
} else {
return main;
}
@@ -599,7 +600,7 @@
if (main == null && merged == null) {
throw notFound;
} else if (merged != null) {
- return new NamingContextEnumeration(merged.values().iterator());
+ return new NamingEnumerationImpl<NameClassPair>(merged.values());
} else {
return main;
}
@@ -662,7 +663,7 @@
if (main == null && merged == null) {
throw notFound;
} else if (merged != null) {
- return new NamingContextBindingsEnumeration(merged.values().iterator(), this);
+ return new NamingEnumerationImpl<Binding>(merged.values());
} else {
return main;
}
@@ -721,7 +722,7 @@
if (main == null && merged == null) {
throw notFound;
} else if (merged != null) {
- return new NamingContextBindingsEnumeration(merged.values().iterator(), this);
+ return new NamingEnumerationImpl<Binding>(merged.values());
} else {
return main;
}
15 years, 1 month
JBossWeb SVN: r1252 - trunk/java/org/apache/catalina/startup.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-11-06 20:30:50 -0500 (Fri, 06 Nov 2009)
New Revision: 1252
Modified:
trunk/java/org/apache/catalina/startup/ContextConfig.java
Log:
- The constraint fix was not correct, despite faking it impressively in my testing.
Modified: trunk/java/org/apache/catalina/startup/ContextConfig.java
===================================================================
--- trunk/java/org/apache/catalina/startup/ContextConfig.java 2009-11-06 18:05:17 UTC (rev 1251)
+++ trunk/java/org/apache/catalina/startup/ContextConfig.java 2009-11-07 01:30:50 UTC (rev 1252)
@@ -2101,7 +2101,6 @@
boolean classDA = servletSecurity.getEmptyRoleSemantic().equals(EmptyRoleSemantic.DENY);
boolean classTP = servletSecurity.getTransportGuarantee().equals(TransportGuarantee.CONFIDENTIAL);
String[] classRA = servletSecurity.getRolesAllowed();
- boolean classConstraint = classDA || classTP || (classRA != null && classRA.length > 0);
Collection<HttpMethodConstraintElement> httpMethodConstraints =
servletSecurity.getHttpMethodConstraints();
@@ -2110,13 +2109,13 @@
{
for (HttpMethodConstraintElement httpMethodConstraint : httpMethodConstraints)
{
+ methodOmissions.add(httpMethodConstraint.getMethodName());
boolean methodPA = httpMethodConstraint.getEmptyRoleSemantic().equals(EmptyRoleSemantic.PERMIT);
boolean methodDA = httpMethodConstraint.getEmptyRoleSemantic().equals(EmptyRoleSemantic.DENY);
boolean methodTP = httpMethodConstraint.getTransportGuarantee().equals(TransportGuarantee.CONFIDENTIAL);
String[] methodRA = httpMethodConstraint.getRolesAllowed();
- if (classConstraint || methodDA || methodTP || (methodRA != null && methodRA.length > 0))
+ if (methodDA || methodTP || (methodRA != null && methodRA.length > 0))
{
- methodOmissions.add(httpMethodConstraint.getMethodName());
// Define a constraint specific for the method
SecurityConstraint constraint = new SecurityConstraint();
if (methodDA) {
@@ -2162,7 +2161,7 @@
}
- if (classConstraint)
+ if (classDA || classTP || (classRA != null && classRA.length > 0))
{
// Define a constraint for the class
SecurityConstraint constraint = new SecurityConstraint();
15 years, 2 months
JBossWeb SVN: r1251 - tags.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-11-06 13:05:17 -0500 (Fri, 06 Nov 2009)
New Revision: 1251
Added:
tags/JBOSSWEB_3_0_0_ALPHA15/
Log:
- Various small fixes.
Copied: tags/JBOSSWEB_3_0_0_ALPHA15 (from rev 1250, trunk)
15 years, 2 months