JBossWeb SVN: r945 - branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/realm.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-02-25 11:53:27 -0500 (Wed, 25 Feb 2009)
New Revision: 945
Modified:
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/realm/DataSourceRealm.java
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/realm/JDBCRealm.java
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/realm/MemoryRealm.java
Log:
- Fix possible NPE in realm auth process.
Modified: branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/realm/DataSourceRealm.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/realm/DataSourceRealm.java 2009-02-25 16:53:15 UTC (rev 944)
+++ branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/realm/DataSourceRealm.java 2009-02-25 16:53:27 UTC (rev 945)
@@ -270,8 +270,9 @@
*/
public Principal authenticate(String username, String credentials) {
- // No user - can't possibly authenticate, don't bother the database then
- if (username == null) {
+ // No user or no credentials
+ // Can't possibly authenticate, don't bother the database then
+ if (username == null || credentials == null) {
return null;
}
Modified: branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/realm/JDBCRealm.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/realm/JDBCRealm.java 2009-02-25 16:53:15 UTC (rev 944)
+++ branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/realm/JDBCRealm.java 2009-02-25 16:53:27 UTC (rev 945)
@@ -330,6 +330,12 @@
*/
public synchronized Principal authenticate(String username, String credentials) {
+ // No user or no credentials
+ // Can't possibly authenticate, don't bother the database then
+ if (username == null || credentials == null) {
+ return null;
+ }
+
// Number of tries is the numebr of attempts to connect to the database
// during this login attempt (if we need to open the database)
// This needs rewritten wuth better pooling support, the existing code
@@ -388,15 +394,10 @@
* @param credentials Password or other credentials to use in
* authenticating this username
*/
- public synchronized Principal authenticate(Connection dbConnection,
+ protected synchronized Principal authenticate(Connection dbConnection,
String username,
String credentials) {
- // No user - can't possibly authenticate
- if (username == null) {
- return (null);
- }
-
// Look up the user's credentials
String dbCredentials = getPassword(username);
Modified: branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/realm/MemoryRealm.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/realm/MemoryRealm.java 2009-02-25 16:53:15 UTC (rev 944)
+++ branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/realm/MemoryRealm.java 2009-02-25 16:53:27 UTC (rev 945)
@@ -147,7 +147,7 @@
(GenericPrincipal) principals.get(username);
boolean validated = false;
- if (principal != null) {
+ if (principal != null && credentials != null) {
if (hasMessageDigest()) {
// Hex hashes should be compared case-insensitive
validated = (digest(credentials)
15 years, 10 months
JBossWeb SVN: r944 - branches/2.0.x/src/share/classes/org/apache/catalina/realm.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-02-25 11:53:15 -0500 (Wed, 25 Feb 2009)
New Revision: 944
Modified:
branches/2.0.x/src/share/classes/org/apache/catalina/realm/DataSourceRealm.java
branches/2.0.x/src/share/classes/org/apache/catalina/realm/JDBCRealm.java
branches/2.0.x/src/share/classes/org/apache/catalina/realm/MemoryRealm.java
Log:
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/realm/DataSourceRealm.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/realm/DataSourceRealm.java 2009-02-25 16:53:02 UTC (rev 943)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/realm/DataSourceRealm.java 2009-02-25 16:53:15 UTC (rev 944)
@@ -270,8 +270,9 @@
*/
public Principal authenticate(String username, String credentials) {
- // No user - can't possibly authenticate, don't bother the database then
- if (username == null) {
+ // No user or no credentials
+ // Can't possibly authenticate, don't bother the database then
+ if (username == null || credentials == null) {
return null;
}
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/realm/JDBCRealm.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/realm/JDBCRealm.java 2009-02-25 16:53:02 UTC (rev 943)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/realm/JDBCRealm.java 2009-02-25 16:53:15 UTC (rev 944)
@@ -330,6 +330,12 @@
*/
public synchronized Principal authenticate(String username, String credentials) {
+ // No user or no credentials
+ // Can't possibly authenticate, don't bother the database then
+ if (username == null || credentials == null) {
+ return null;
+ }
+
// Number of tries is the numebr of attempts to connect to the database
// during this login attempt (if we need to open the database)
// This needs rewritten wuth better pooling support, the existing code
@@ -388,15 +394,10 @@
* @param credentials Password or other credentials to use in
* authenticating this username
*/
- public synchronized Principal authenticate(Connection dbConnection,
+ protected synchronized Principal authenticate(Connection dbConnection,
String username,
String credentials) {
- // No user - can't possibly authenticate
- if (username == null) {
- return (null);
- }
-
// Look up the user's credentials
String dbCredentials = getPassword(username);
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/realm/MemoryRealm.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/realm/MemoryRealm.java 2009-02-25 16:53:02 UTC (rev 943)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/realm/MemoryRealm.java 2009-02-25 16:53:15 UTC (rev 944)
@@ -147,7 +147,7 @@
(GenericPrincipal) principals.get(username);
boolean validated = false;
- if (principal != null) {
+ if (principal != null && credentials != null) {
if (hasMessageDigest()) {
// Hex hashes should be compared case-insensitive
validated = (digest(credentials)
15 years, 10 months
JBossWeb SVN: r943 - in branches/2.1.x: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-02-25 11:53:02 -0500 (Wed, 25 Feb 2009)
New Revision: 943
Modified:
branches/2.1.x/java/org/apache/catalina/realm/DataSourceRealm.java
branches/2.1.x/java/org/apache/catalina/realm/JDBCRealm.java
branches/2.1.x/java/org/apache/catalina/realm/MemoryRealm.java
branches/2.1.x/webapps/docs/changelog.xml
Log:
- Fix possible NPE in realm auth process.
Modified: branches/2.1.x/java/org/apache/catalina/realm/DataSourceRealm.java
===================================================================
--- branches/2.1.x/java/org/apache/catalina/realm/DataSourceRealm.java 2009-02-25 16:52:17 UTC (rev 942)
+++ branches/2.1.x/java/org/apache/catalina/realm/DataSourceRealm.java 2009-02-25 16:53:02 UTC (rev 943)
@@ -270,8 +270,9 @@
*/
public Principal authenticate(String username, String credentials) {
- // No user - can't possibly authenticate, don't bother the database then
- if (username == null) {
+ // No user or no credentials
+ // Can't possibly authenticate, don't bother the database then
+ if (username == null || credentials == null) {
return null;
}
Modified: branches/2.1.x/java/org/apache/catalina/realm/JDBCRealm.java
===================================================================
--- branches/2.1.x/java/org/apache/catalina/realm/JDBCRealm.java 2009-02-25 16:52:17 UTC (rev 942)
+++ branches/2.1.x/java/org/apache/catalina/realm/JDBCRealm.java 2009-02-25 16:53:02 UTC (rev 943)
@@ -329,6 +329,12 @@
*/
public synchronized Principal authenticate(String username, String credentials) {
+ // No user or no credentials
+ // Can't possibly authenticate, don't bother the database then
+ if (username == null || credentials == null) {
+ return null;
+ }
+
// Number of tries is the numebr of attempts to connect to the database
// during this login attempt (if we need to open the database)
// This needs rewritten wuth better pooling support, the existing code
@@ -387,15 +393,10 @@
* @param credentials Password or other credentials to use in
* authenticating this username
*/
- public synchronized Principal authenticate(Connection dbConnection,
+ protected synchronized Principal authenticate(Connection dbConnection,
String username,
String credentials) {
- // No user - can't possibly authenticate
- if (username == null) {
- return (null);
- }
-
// Look up the user's credentials
String dbCredentials = getPassword(username);
Modified: branches/2.1.x/java/org/apache/catalina/realm/MemoryRealm.java
===================================================================
--- branches/2.1.x/java/org/apache/catalina/realm/MemoryRealm.java 2009-02-25 16:52:17 UTC (rev 942)
+++ branches/2.1.x/java/org/apache/catalina/realm/MemoryRealm.java 2009-02-25 16:53:02 UTC (rev 943)
@@ -147,7 +147,7 @@
(GenericPrincipal) principals.get(username);
boolean validated = false;
- if (principal != null) {
+ if (principal != null && credentials != null) {
if (hasMessageDigest()) {
// Hex hashes should be compared case-insensitive
validated = (digest(credentials)
Modified: branches/2.1.x/webapps/docs/changelog.xml
===================================================================
--- branches/2.1.x/webapps/docs/changelog.xml 2009-02-25 16:52:17 UTC (rev 942)
+++ branches/2.1.x/webapps/docs/changelog.xml 2009-02-25 16:53:02 UTC (rev 943)
@@ -23,6 +23,9 @@
</subsection>
<subsection name="Catalina">
<changelog>
+ <fix>
+ NPE in various realms. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
15 years, 10 months
JBossWeb SVN: r942 - in trunk: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-02-25 11:52:17 -0500 (Wed, 25 Feb 2009)
New Revision: 942
Modified:
trunk/java/org/apache/catalina/realm/DataSourceRealm.java
trunk/java/org/apache/catalina/realm/JDBCRealm.java
trunk/java/org/apache/catalina/realm/MemoryRealm.java
trunk/webapps/docs/changelog.xml
Log:
- Fix possible NPE in realm auth process.
Modified: trunk/java/org/apache/catalina/realm/DataSourceRealm.java
===================================================================
--- trunk/java/org/apache/catalina/realm/DataSourceRealm.java 2009-02-25 14:37:49 UTC (rev 941)
+++ trunk/java/org/apache/catalina/realm/DataSourceRealm.java 2009-02-25 16:52:17 UTC (rev 942)
@@ -270,8 +270,9 @@
*/
public Principal authenticate(String username, String credentials) {
- // No user - can't possibly authenticate, don't bother the database then
- if (username == null) {
+ // No user or no credentials
+ // Can't possibly authenticate, don't bother the database then
+ if (username == null || credentials == null) {
return null;
}
Modified: trunk/java/org/apache/catalina/realm/JDBCRealm.java
===================================================================
--- trunk/java/org/apache/catalina/realm/JDBCRealm.java 2009-02-25 14:37:49 UTC (rev 941)
+++ trunk/java/org/apache/catalina/realm/JDBCRealm.java 2009-02-25 16:52:17 UTC (rev 942)
@@ -329,6 +329,12 @@
*/
public synchronized Principal authenticate(String username, String credentials) {
+ // No user or no credentials
+ // Can't possibly authenticate, don't bother the database then
+ if (username == null || credentials == null) {
+ return null;
+ }
+
// Number of tries is the numebr of attempts to connect to the database
// during this login attempt (if we need to open the database)
// This needs rewritten wuth better pooling support, the existing code
@@ -387,15 +393,10 @@
* @param credentials Password or other credentials to use in
* authenticating this username
*/
- public synchronized Principal authenticate(Connection dbConnection,
+ protected synchronized Principal authenticate(Connection dbConnection,
String username,
String credentials) {
- // No user - can't possibly authenticate
- if (username == null) {
- return (null);
- }
-
// Look up the user's credentials
String dbCredentials = getPassword(username);
Modified: trunk/java/org/apache/catalina/realm/MemoryRealm.java
===================================================================
--- trunk/java/org/apache/catalina/realm/MemoryRealm.java 2009-02-25 14:37:49 UTC (rev 941)
+++ trunk/java/org/apache/catalina/realm/MemoryRealm.java 2009-02-25 16:52:17 UTC (rev 942)
@@ -147,7 +147,7 @@
(GenericPrincipal) principals.get(username);
boolean validated = false;
- if (principal != null) {
+ if (principal != null && credentials != null) {
if (hasMessageDigest()) {
// Hex hashes should be compared case-insensitive
validated = (digest(credentials)
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2009-02-25 14:37:49 UTC (rev 941)
+++ trunk/webapps/docs/changelog.xml 2009-02-25 16:52:17 UTC (rev 942)
@@ -50,6 +50,9 @@
</subsection>
<subsection name="Catalina">
<changelog>
+ <fix>
+ NPE in various realms. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
15 years, 10 months
JBossWeb SVN: r941 - trunk/java/org/apache/catalina/startup.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-02-25 09:37:49 -0500 (Wed, 25 Feb 2009)
New Revision: 941
Modified:
trunk/java/org/apache/catalina/startup/ContextConfig.java
Log:
- Port some cleanup.
Modified: trunk/java/org/apache/catalina/startup/ContextConfig.java
===================================================================
--- trunk/java/org/apache/catalina/startup/ContextConfig.java 2009-02-25 13:04:57 UTC (rev 940)
+++ trunk/java/org/apache/catalina/startup/ContextConfig.java 2009-02-25 14:37:49 UTC (rev 941)
@@ -381,7 +381,7 @@
synchronized (webDigester) {
try {
if (altDDName != null) {
- url = new File(altDDName).toURL();
+ url = new File(altDDName).toURI().toURL();
} else {
url = servletContext.getResource(
Constants.ApplicationWebXml);
@@ -958,8 +958,7 @@
}
- protected void antiLocking()
- throws IOException {
+ protected void antiLocking() {
if ((context instanceof StandardContext)
&& ((StandardContext) context).getAntiResourceLocking()) {
@@ -1057,13 +1056,7 @@
* Process a "before start" event for this Context.
*/
protected synchronized void beforeStart() {
-
- try {
- antiLocking();
- } catch (IOException e) {
- log.error(sm.getString("contextConfig.antiLocking"), e);
- }
-
+ antiLocking();
}
15 years, 10 months
JBossWeb SVN: r940 - in trunk/java/org/apache/jasper: compiler and 1 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-02-25 08:04:57 -0500 (Wed, 25 Feb 2009)
New Revision: 940
Modified:
trunk/java/org/apache/jasper/Constants.java
trunk/java/org/apache/jasper/compiler/JspDocumentParser.java
trunk/java/org/apache/jasper/servlet/JspServlet.java
Log:
- Fix portions of the code which seemed obviously at odds with the concept of providing (most of the) TLD data from JBoss metadata.
- Right now, it seems replacing the options with a JBoss class which would use the caching mechanism and provide a new TagLibraryInfo
implementation is the right way. If a TLD is not found, it will use the old Jasper mechanism.
Modified: trunk/java/org/apache/jasper/Constants.java
===================================================================
--- trunk/java/org/apache/jasper/Constants.java 2009-02-23 13:56:28 UTC (rev 939)
+++ trunk/java/org/apache/jasper/Constants.java 2009-02-25 13:04:57 UTC (rev 940)
@@ -58,6 +58,12 @@
};
/**
+ * ServletContext attribute for the JSP Servlet options.
+ */
+ public static final String SERVLET_OPTIONS =
+ System.getProperty("org.apache.jasper.Constants.SERVLET_OPTIONS", "org.apache.catalina.jsp_options");
+
+ /**
* ServletContext attribute for classpath. This is tomcat specific.
* Other servlet engines may choose to support this attribute if they
* want to have this JSP engine running on them.
Modified: trunk/java/org/apache/jasper/compiler/JspDocumentParser.java
===================================================================
--- trunk/java/org/apache/jasper/compiler/JspDocumentParser.java 2009-02-23 13:56:28 UTC (rev 939)
+++ trunk/java/org/apache/jasper/compiler/JspDocumentParser.java 2009-02-25 13:04:57 UTC (rev 940)
@@ -1251,29 +1251,33 @@
isPlainUri = true;
}
- String[] location = ctxt.getTldLocation(uri);
- if (location != null || !isPlainUri) {
- if (ctxt.getOptions().isCaching()) {
- result = (TagLibraryInfoImpl) ctxt.getOptions().getCache().get(uri);
- }
- if (result == null) {
- /*
- * If the uri value is a plain uri, a translation error must
- * not be generated if the uri is not found in the taglib map.
- * Instead, any actions in the namespace defined by the uri
- * value must be treated as uninterpreted.
- */
- result =
- new TagLibraryInfoImpl(
- ctxt,
- parserController,
- pageInfo,
- prefix,
- uri,
- location,
- err);
- if (ctxt.getOptions().isCaching()) {
- ctxt.getOptions().getCache().put(uri, result);
+ if (ctxt.getOptions().isCaching()) {
+ result = (TagLibraryInfo) ctxt.getOptions().getCache().get(uri);
+ }
+ if (result == null) {
+ // Fallback to Jasper's legacy scanning if nothing was provided
+ // by the options' TLD cache
+ String[] location = ctxt.getTldLocation(uri);
+ if (location != null || !isPlainUri) {
+ if (result == null) {
+ /*
+ * If the uri value is a plain uri, a translation error must
+ * not be generated if the uri is not found in the taglib map.
+ * Instead, any actions in the namespace defined by the uri
+ * value must be treated as uninterpreted.
+ */
+ result =
+ new TagLibraryInfoImpl(
+ ctxt,
+ parserController,
+ pageInfo,
+ prefix,
+ uri,
+ location,
+ err);
+ if (ctxt.getOptions().isCaching()) {
+ ctxt.getOptions().getCache().put(uri, result);
+ }
}
}
}
Modified: trunk/java/org/apache/jasper/servlet/JspServlet.java
===================================================================
--- trunk/java/org/apache/jasper/servlet/JspServlet.java 2009-02-23 13:56:28 UTC (rev 939)
+++ trunk/java/org/apache/jasper/servlet/JspServlet.java 2009-02-25 13:04:57 UTC (rev 940)
@@ -19,7 +19,6 @@
import java.io.IOException;
import java.lang.reflect.Constructor;
-import java.util.Enumeration;
import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
@@ -73,29 +72,34 @@
this.config = config;
this.context = config.getServletContext();
- // Initialize the JSP Runtime Context
- // Check for a custom Options implementation
- String engineOptionsName =
- config.getInitParameter("engineOptionsClass");
- if (engineOptionsName != null) {
- // Instantiate the indicated Options implementation
- try {
- ClassLoader loader = Thread.currentThread()
- .getContextClassLoader();
- Class engineOptionsClass = loader.loadClass(engineOptionsName);
- Class[] ctorSig = { ServletConfig.class, ServletContext.class };
- Constructor ctor = engineOptionsClass.getConstructor(ctorSig);
- Object[] args = { config, context };
- options = (Options) ctor.newInstance(args);
- } catch (Throwable e) {
- // Need to localize this.
- log.warn("Failed to load engineOptionsClass", e);
+ Object optionsObject = context.getAttribute(Constants.SERVLET_OPTIONS);
+ if (optionsObject != null && (optionsObject instanceof Options)) {
+ options = (Options) optionsObject;
+ } else {
+ // Initialize the JSP Runtime Context
+ // Check for a custom Options implementation
+ String engineOptionsName =
+ config.getInitParameter("engineOptionsClass");
+ if (engineOptionsName != null) {
+ // Instantiate the indicated Options implementation
+ try {
+ ClassLoader loader = Thread.currentThread()
+ .getContextClassLoader();
+ Class engineOptionsClass = loader.loadClass(engineOptionsName);
+ Class[] ctorSig = { ServletConfig.class, ServletContext.class };
+ Constructor ctor = engineOptionsClass.getConstructor(ctorSig);
+ Object[] args = { config, context };
+ options = (Options) ctor.newInstance(args);
+ } catch (Throwable e) {
+ // Need to localize this.
+ log.warn("Failed to load engineOptionsClass", e);
+ // Use the default Options implementation
+ options = new EmbeddedServletOptions(config, context);
+ }
+ } else {
// Use the default Options implementation
options = new EmbeddedServletOptions(config, context);
}
- } else {
- // Use the default Options implementation
- options = new EmbeddedServletOptions(config, context);
}
rctxt = new JspRuntimeContext(context, options);
15 years, 10 months
JBossWeb SVN: r939 - in branches/2.1.x: java/org/apache/catalina/startup and 3 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-02-23 08:56:28 -0500 (Mon, 23 Feb 2009)
New Revision: 939
Modified:
branches/2.1.x/build.properties.default
branches/2.1.x/java/org/apache/catalina/startup/WebRuleSet.java
branches/2.1.x/java/org/apache/coyote/http11/Http11AprProtocol.java
branches/2.1.x/java/org/apache/coyote/http11/Http11Protocol.java
branches/2.1.x/java/org/apache/jasper/el/ELContextImpl.java
branches/2.1.x/java/org/apache/jasper/el/ELResolverImpl.java
branches/2.1.x/java/org/apache/jasper/el/ExpressionEvaluatorImpl.java
branches/2.1.x/webapps/docs/changelog.xml
Log:
- Port Tomcat patches, incl EL resolver improvement for the security manager.
Modified: branches/2.1.x/build.properties.default
===================================================================
--- branches/2.1.x/build.properties.default 2009-02-23 13:56:06 UTC (rev 938)
+++ branches/2.1.x/build.properties.default 2009-02-23 13:56:28 UTC (rev 939)
@@ -12,7 +12,7 @@
# ----- Version Control Flags -----
version.major=2
version.minor=1
-version.build=1
+version.build=3
version.patch=0
version.tag=SNAPSHOT
Modified: branches/2.1.x/java/org/apache/catalina/startup/WebRuleSet.java
===================================================================
--- branches/2.1.x/java/org/apache/catalina/startup/WebRuleSet.java 2009-02-23 13:56:06 UTC (rev 938)
+++ branches/2.1.x/java/org/apache/catalina/startup/WebRuleSet.java 2009-02-23 13:56:28 UTC (rev 939)
@@ -539,7 +539,7 @@
throws Exception {
if (isLoginConfigSet){
throw new IllegalArgumentException(
- "<login-config> element is limited to 1 occurance");
+ "<login-config> element is limited to 1 occurrence");
}
isLoginConfigSet = true;
}
@@ -560,7 +560,7 @@
throws Exception {
if (isJspConfigSet){
throw new IllegalArgumentException(
- "<jsp-config> element is limited to 1 occurance");
+ "<jsp-config> element is limited to 1 occurrence");
}
isJspConfigSet = true;
}
@@ -581,7 +581,7 @@
throws Exception {
if (isSessionConfigSet){
throw new IllegalArgumentException(
- "<session-config> element is limited to 1 occurance");
+ "<session-config> element is limited to 1 occurrence");
}
isSessionConfigSet = true;
}
Modified: branches/2.1.x/java/org/apache/coyote/http11/Http11AprProtocol.java
===================================================================
--- branches/2.1.x/java/org/apache/coyote/http11/Http11AprProtocol.java 2009-02-23 13:56:06 UTC (rev 938)
+++ branches/2.1.x/java/org/apache/coyote/http11/Http11AprProtocol.java 2009-02-23 13:56:28 UTC (rev 939)
@@ -32,7 +32,6 @@
import javax.management.ObjectName;
import org.apache.coyote.ActionCode;
-import org.apache.coyote.ActionHook;
import org.apache.coyote.Adapter;
import org.apache.coyote.ProtocolHandler;
import org.apache.coyote.RequestGroupInfo;
@@ -588,9 +587,7 @@
processor = createProcessor();
}
- if (processor instanceof ActionHook) {
- ((ActionHook) processor).action(ActionCode.ACTION_START, null);
- }
+ processor.action(ActionCode.ACTION_START, null);
SocketState state = processor.process(socket);
if (state == SocketState.LONG) {
Modified: branches/2.1.x/java/org/apache/coyote/http11/Http11Protocol.java
===================================================================
--- branches/2.1.x/java/org/apache/coyote/http11/Http11Protocol.java 2009-02-23 13:56:06 UTC (rev 938)
+++ branches/2.1.x/java/org/apache/coyote/http11/Http11Protocol.java 2009-02-23 13:56:28 UTC (rev 939)
@@ -32,7 +32,6 @@
import javax.management.ObjectName;
import org.apache.coyote.ActionCode;
-import org.apache.coyote.ActionHook;
import org.apache.coyote.Adapter;
import org.apache.coyote.ProtocolHandler;
import org.apache.coyote.RequestGroupInfo;
@@ -587,9 +586,7 @@
processor = createProcessor();
}
- if (processor instanceof ActionHook) {
- ((ActionHook) processor).action(ActionCode.ACTION_START, null);
- }
+ processor.action(ActionCode.ACTION_START, null);
if (proto.secure && (proto.sslImplementation != null)) {
processor.setSSLSupport
@@ -625,9 +622,7 @@
// if(proto.adapter != null) proto.adapter.recycle();
// processor.recycle();
- if (processor instanceof ActionHook) {
- ((ActionHook) processor).action(ActionCode.ACTION_STOP, null);
- }
+ processor.action(ActionCode.ACTION_STOP, null);
recycledProcessors.offer(processor);
}
return false;
Modified: branches/2.1.x/java/org/apache/jasper/el/ELContextImpl.java
===================================================================
--- branches/2.1.x/java/org/apache/jasper/el/ELContextImpl.java 2009-02-23 13:56:06 UTC (rev 938)
+++ branches/2.1.x/java/org/apache/jasper/el/ELContextImpl.java 2009-02-23 13:56:28 UTC (rev 939)
@@ -26,6 +26,8 @@
import javax.el.ValueExpression;
import javax.el.VariableMapper;
+import org.apache.catalina.Globals;
+
/**
* Implementation of ELContext
*
@@ -61,12 +63,21 @@
private final ELResolver resolver;
- private FunctionMapper functionMapper = NullFunctionMapper; // immutable
+ private FunctionMapper functionMapper;
private VariableMapper variableMapper;
public ELContextImpl() {
- this(ELResolverImpl.DefaultResolver);
+ this(ELResolverImpl.getDefaultResolver());
+ if (Globals.IS_SECURITY_ENABLED) {
+ functionMapper = new FunctionMapper() {
+ public Method resolveFunction(String prefix, String localName) {
+ return null;
+ }
+ };
+ } else {
+ functionMapper = NullFunctionMapper;
+ }
}
public ELContextImpl(ELResolver resolver) {
Modified: branches/2.1.x/java/org/apache/jasper/el/ELResolverImpl.java
===================================================================
--- branches/2.1.x/java/org/apache/jasper/el/ELResolverImpl.java 2009-02-23 13:56:06 UTC (rev 938)
+++ branches/2.1.x/java/org/apache/jasper/el/ELResolverImpl.java 2009-02-23 13:56:28 UTC (rev 939)
@@ -32,115 +32,130 @@
import javax.el.ResourceBundleELResolver;
import javax.servlet.jsp.el.VariableResolver;
+import org.apache.catalina.Globals;
+
public final class ELResolverImpl extends ELResolver {
-
- public final static ELResolver DefaultResolver = new CompositeELResolver();
+ /** @deprecated - Use getDefaultResolver(). Needs to be made private */
+ public final static ELResolver DefaultResolver = new CompositeELResolver();
- static {
- ((CompositeELResolver) DefaultResolver).add(new MapELResolver());
- ((CompositeELResolver) DefaultResolver).add(new ResourceBundleELResolver());
- ((CompositeELResolver) DefaultResolver).add(new ListELResolver());
- ((CompositeELResolver) DefaultResolver).add(new ArrayELResolver());
- ((CompositeELResolver) DefaultResolver).add(new BeanELResolver());
- }
+ static {
+ ((CompositeELResolver) DefaultResolver).add(new MapELResolver());
+ ((CompositeELResolver) DefaultResolver).add(new ResourceBundleELResolver());
+ ((CompositeELResolver) DefaultResolver).add(new ListELResolver());
+ ((CompositeELResolver) DefaultResolver).add(new ArrayELResolver());
+ ((CompositeELResolver) DefaultResolver).add(new BeanELResolver());
+ }
- private final VariableResolver variableResolver;
+ private final VariableResolver variableResolver;
- public ELResolverImpl(VariableResolver variableResolver) {
- this.variableResolver = variableResolver;
- }
+ public ELResolverImpl(VariableResolver variableResolver) {
+ this.variableResolver = variableResolver;
+ }
- public Object getValue(ELContext context, Object base, Object property)
- throws NullPointerException, PropertyNotFoundException, ELException {
- if (context == null) {
- throw new NullPointerException();
- }
+ public Object getValue(ELContext context, Object base, Object property)
+ throws NullPointerException, PropertyNotFoundException, ELException {
+ if (context == null) {
+ throw new NullPointerException();
+ }
- if (base == null) {
- context.setPropertyResolved(true);
- if (property != null) {
- try {
- return this.variableResolver.resolveVariable(property
- .toString());
- } catch (javax.servlet.jsp.el.ELException e) {
- throw new ELException(e.getMessage(), e.getCause());
- }
- }
- }
+ if (base == null) {
+ context.setPropertyResolved(true);
+ if (property != null) {
+ try {
+ return this.variableResolver.resolveVariable(property
+ .toString());
+ } catch (javax.servlet.jsp.el.ELException e) {
+ throw new ELException(e.getMessage(), e.getCause());
+ }
+ }
+ }
- if (!context.isPropertyResolved()) {
- return DefaultResolver.getValue(context, base, property);
- }
- return null;
- }
+ if (!context.isPropertyResolved()) {
+ return getDefaultResolver().getValue(context, base, property);
+ }
+ return null;
+ }
- public Class<?> getType(ELContext context, Object base, Object property)
- throws NullPointerException, PropertyNotFoundException, ELException {
- if (context == null) {
- throw new NullPointerException();
- }
+ public Class<?> getType(ELContext context, Object base, Object property)
+ throws NullPointerException, PropertyNotFoundException, ELException {
+ if (context == null) {
+ throw new NullPointerException();
+ }
- if (base == null) {
- context.setPropertyResolved(true);
- if (property != null) {
- try {
- Object obj = this.variableResolver.resolveVariable(property
- .toString());
- return (obj != null) ? obj.getClass() : null;
- } catch (javax.servlet.jsp.el.ELException e) {
- throw new ELException(e.getMessage(), e.getCause());
- }
- }
- }
+ if (base == null) {
+ context.setPropertyResolved(true);
+ if (property != null) {
+ try {
+ Object obj = this.variableResolver.resolveVariable(property
+ .toString());
+ return (obj != null) ? obj.getClass() : null;
+ } catch (javax.servlet.jsp.el.ELException e) {
+ throw new ELException(e.getMessage(), e.getCause());
+ }
+ }
+ }
- if (!context.isPropertyResolved()) {
- return DefaultResolver.getType(context, base, property);
- }
- return null;
- }
+ if (!context.isPropertyResolved()) {
+ return getDefaultResolver().getType(context, base, property);
+ }
+ return null;
+ }
- public void setValue(ELContext context, Object base, Object property,
- Object value) throws NullPointerException,
- PropertyNotFoundException, PropertyNotWritableException,
- ELException {
- if (context == null) {
- throw new NullPointerException();
- }
+ public void setValue(ELContext context, Object base, Object property,
+ Object value) throws NullPointerException,
+ PropertyNotFoundException, PropertyNotWritableException,
+ ELException {
+ if (context == null) {
+ throw new NullPointerException();
+ }
- if (base == null) {
- context.setPropertyResolved(true);
- throw new PropertyNotWritableException(
- "Legacy VariableResolver wrapped, not writable");
- }
+ if (base == null) {
+ context.setPropertyResolved(true);
+ throw new PropertyNotWritableException(
+ "Legacy VariableResolver wrapped, not writable");
+ }
- if (!context.isPropertyResolved()) {
- DefaultResolver.setValue(context, base, property, value);
- }
- }
+ if (!context.isPropertyResolved()) {
+ getDefaultResolver().setValue(context, base, property, value);
+ }
+ }
- public boolean isReadOnly(ELContext context, Object base, Object property)
- throws NullPointerException, PropertyNotFoundException, ELException {
- if (context == null) {
- throw new NullPointerException();
- }
+ public boolean isReadOnly(ELContext context, Object base, Object property)
+ throws NullPointerException, PropertyNotFoundException, ELException {
+ if (context == null) {
+ throw new NullPointerException();
+ }
- if (base == null) {
- context.setPropertyResolved(true);
- return true;
- }
+ if (base == null) {
+ context.setPropertyResolved(true);
+ return true;
+ }
- return DefaultResolver.isReadOnly(context, base, property);
- }
+ return getDefaultResolver().isReadOnly(context, base, property);
+ }
- public Iterator<java.beans.FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
- return DefaultResolver.getFeatureDescriptors(context, base);
- }
+ public Iterator<java.beans.FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
+ return getDefaultResolver().getFeatureDescriptors(context, base);
+ }
- public Class<?> getCommonPropertyType(ELContext context, Object base) {
- if (base == null) {
- return String.class;
- }
- return DefaultResolver.getCommonPropertyType(context, base);
- }
+ public Class<?> getCommonPropertyType(ELContext context, Object base) {
+ if (base == null) {
+ return String.class;
+ }
+ return getDefaultResolver().getCommonPropertyType(context, base);
+ }
+ public static ELResolver getDefaultResolver() {
+ if (Globals.IS_SECURITY_ENABLED) {
+ ELResolver defaultResolver = new CompositeELResolver();
+ ((CompositeELResolver) defaultResolver).add(new MapELResolver());
+ ((CompositeELResolver) defaultResolver).add(new ResourceBundleELResolver());
+ ((CompositeELResolver) defaultResolver).add(new ListELResolver());
+ ((CompositeELResolver) defaultResolver).add(new ArrayELResolver());
+ ((CompositeELResolver) defaultResolver).add(new BeanELResolver());
+ return defaultResolver;
+ } else {
+ return DefaultResolver;
+ }
+ }
}
Modified: branches/2.1.x/java/org/apache/jasper/el/ExpressionEvaluatorImpl.java
===================================================================
--- branches/2.1.x/java/org/apache/jasper/el/ExpressionEvaluatorImpl.java 2009-02-23 13:56:06 UTC (rev 938)
+++ branches/2.1.x/java/org/apache/jasper/el/ExpressionEvaluatorImpl.java 2009-02-23 13:56:28 UTC (rev 939)
@@ -16,7 +16,6 @@
*/
package org.apache.jasper.el;
-import javax.el.ELContext;
import javax.el.ExpressionFactory;
import javax.el.ValueExpression;
import javax.servlet.jsp.el.ELException;
@@ -29,30 +28,31 @@
public final class ExpressionEvaluatorImpl extends ExpressionEvaluator {
- private final ExpressionFactory factory;
-
- public ExpressionEvaluatorImpl(ExpressionFactory factory) {
- this.factory = factory;
- }
+ private final ExpressionFactory factory;
+
+ public ExpressionEvaluatorImpl(ExpressionFactory factory) {
+ this.factory = factory;
+ }
- public Expression parseExpression(String expression, Class expectedType,
- FunctionMapper fMapper) throws ELException {
- try {
- ELContextImpl ctx = new ELContextImpl(ELResolverImpl.DefaultResolver);
+ public Expression parseExpression(String expression, Class expectedType,
+ FunctionMapper fMapper) throws ELException {
+ try {
+ ELContextImpl ctx =
+ new ELContextImpl(ELResolverImpl.getDefaultResolver());
if (fMapper != null) {
ctx.setFunctionMapper(new FunctionMapperImpl(fMapper));
}
- ValueExpression ve = this.factory.createValueExpression(ctx, expression, expectedType);
- return new ExpressionImpl(ve);
- } catch (javax.el.ELException e) {
- throw new ELParseException(e.getMessage());
- }
- }
+ ValueExpression ve = this.factory.createValueExpression(ctx, expression, expectedType);
+ return new ExpressionImpl(ve);
+ } catch (javax.el.ELException e) {
+ throw new ELParseException(e.getMessage());
+ }
+ }
- public Object evaluate(String expression, Class expectedType,
- VariableResolver vResolver, FunctionMapper fMapper)
- throws ELException {
- return this.parseExpression(expression, expectedType, fMapper).evaluate(vResolver);
- }
+ public Object evaluate(String expression, Class expectedType,
+ VariableResolver vResolver, FunctionMapper fMapper)
+ throws ELException {
+ return this.parseExpression(expression, expectedType, fMapper).evaluate(vResolver);
+ }
}
Modified: branches/2.1.x/webapps/docs/changelog.xml
===================================================================
--- branches/2.1.x/webapps/docs/changelog.xml 2009-02-23 13:56:06 UTC (rev 938)
+++ branches/2.1.x/webapps/docs/changelog.xml 2009-02-23 13:56:28 UTC (rev 939)
@@ -16,6 +16,31 @@
<body>
+<section name="JBoss Web 2.1.3.CR1 (remm)">
+ <subsection name="General">
+ <changelog>
+ </changelog>
+ </subsection>
+ <subsection name="Catalina">
+ <changelog>
+ </changelog>
+ </subsection>
+ <subsection name="Coyote">
+ <changelog>
+ <fix>
+ Remove useless instanceof in the HTTP protocol. (markt)
+ </fix>
+ </changelog>
+ </subsection>
+ <subsection name="Jasper">
+ <changelog>
+ <fix>
+ EL resolver improvements when using a security manager. (markt)
+ </fix>
+ </changelog>
+ </subsection>
+</section>
+
<section name="JBoss Web 2.1.2.GA (remm)">
<subsection name="General">
<changelog>
15 years, 10 months
JBossWeb SVN: r938 - in trunk: java/org/apache/catalina/startup and 3 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-02-23 08:56:06 -0500 (Mon, 23 Feb 2009)
New Revision: 938
Modified:
trunk/java/org/apache/catalina/core/ApplicationContextFacade.java
trunk/java/org/apache/catalina/startup/WebRuleSet.java
trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
trunk/java/org/apache/coyote/http11/Http11Protocol.java
trunk/java/org/apache/jasper/el/ELContextImpl.java
trunk/java/org/apache/jasper/el/ELResolverImpl.java
trunk/java/org/apache/jasper/el/ExpressionEvaluatorImpl.java
trunk/webapps/docs/changelog.xml
Log:
- Port Tomcat patches, incl EL resolver improvement for the security manager.
Modified: trunk/java/org/apache/catalina/core/ApplicationContextFacade.java
===================================================================
--- trunk/java/org/apache/catalina/core/ApplicationContextFacade.java 2009-02-16 17:52:55 UTC (rev 937)
+++ trunk/java/org/apache/catalina/core/ApplicationContextFacade.java 2009-02-23 13:56:06 UTC (rev 938)
@@ -105,6 +105,9 @@
classCache.put("getRealPath", clazz);
classCache.put("getAttribute", clazz);
classCache.put("log", clazz);
+ classCache.put("setSessionTrackingModes", new Class[]{EnumSet.class} );
+ classCache.put("setSessionCookieConfig",
+ new Class[]{SessionCookieConfig.class});
}
Modified: trunk/java/org/apache/catalina/startup/WebRuleSet.java
===================================================================
--- trunk/java/org/apache/catalina/startup/WebRuleSet.java 2009-02-16 17:52:55 UTC (rev 937)
+++ trunk/java/org/apache/catalina/startup/WebRuleSet.java 2009-02-23 13:56:06 UTC (rev 938)
@@ -539,7 +539,7 @@
throws Exception {
if (isLoginConfigSet){
throw new IllegalArgumentException(
- "<login-config> element is limited to 1 occurance");
+ "<login-config> element is limited to 1 occurrence");
}
isLoginConfigSet = true;
}
@@ -560,7 +560,7 @@
throws Exception {
if (isJspConfigSet){
throw new IllegalArgumentException(
- "<jsp-config> element is limited to 1 occurance");
+ "<jsp-config> element is limited to 1 occurrence");
}
isJspConfigSet = true;
}
@@ -581,7 +581,7 @@
throws Exception {
if (isSessionConfigSet){
throw new IllegalArgumentException(
- "<session-config> element is limited to 1 occurance");
+ "<session-config> element is limited to 1 occurrence");
}
isSessionConfigSet = true;
}
Modified: trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
===================================================================
--- trunk/java/org/apache/coyote/http11/Http11AprProtocol.java 2009-02-16 17:52:55 UTC (rev 937)
+++ trunk/java/org/apache/coyote/http11/Http11AprProtocol.java 2009-02-23 13:56:06 UTC (rev 938)
@@ -32,7 +32,6 @@
import javax.management.ObjectName;
import org.apache.coyote.ActionCode;
-import org.apache.coyote.ActionHook;
import org.apache.coyote.Adapter;
import org.apache.coyote.ProtocolHandler;
import org.apache.coyote.RequestGroupInfo;
@@ -588,9 +587,7 @@
processor = createProcessor();
}
- if (processor instanceof ActionHook) {
- ((ActionHook) processor).action(ActionCode.ACTION_START, null);
- }
+ processor.action(ActionCode.ACTION_START, null);
SocketState state = processor.process(socket);
if (state == SocketState.LONG) {
Modified: trunk/java/org/apache/coyote/http11/Http11Protocol.java
===================================================================
--- trunk/java/org/apache/coyote/http11/Http11Protocol.java 2009-02-16 17:52:55 UTC (rev 937)
+++ trunk/java/org/apache/coyote/http11/Http11Protocol.java 2009-02-23 13:56:06 UTC (rev 938)
@@ -32,7 +32,6 @@
import javax.management.ObjectName;
import org.apache.coyote.ActionCode;
-import org.apache.coyote.ActionHook;
import org.apache.coyote.Adapter;
import org.apache.coyote.ProtocolHandler;
import org.apache.coyote.RequestGroupInfo;
@@ -587,9 +586,7 @@
processor = createProcessor();
}
- if (processor instanceof ActionHook) {
- ((ActionHook) processor).action(ActionCode.ACTION_START, null);
- }
+ processor.action(ActionCode.ACTION_START, null);
if (proto.secure && (proto.sslImplementation != null)) {
processor.setSSLSupport
@@ -625,9 +622,7 @@
// if(proto.adapter != null) proto.adapter.recycle();
// processor.recycle();
- if (processor instanceof ActionHook) {
- ((ActionHook) processor).action(ActionCode.ACTION_STOP, null);
- }
+ processor.action(ActionCode.ACTION_STOP, null);
recycledProcessors.offer(processor);
}
return false;
Modified: trunk/java/org/apache/jasper/el/ELContextImpl.java
===================================================================
--- trunk/java/org/apache/jasper/el/ELContextImpl.java 2009-02-16 17:52:55 UTC (rev 937)
+++ trunk/java/org/apache/jasper/el/ELContextImpl.java 2009-02-23 13:56:06 UTC (rev 938)
@@ -26,6 +26,8 @@
import javax.el.ValueExpression;
import javax.el.VariableMapper;
+import org.apache.catalina.Globals;
+
/**
* Implementation of ELContext
*
@@ -61,12 +63,21 @@
private final ELResolver resolver;
- private FunctionMapper functionMapper = NullFunctionMapper; // immutable
+ private FunctionMapper functionMapper;
private VariableMapper variableMapper;
public ELContextImpl() {
- this(ELResolverImpl.DefaultResolver);
+ this(ELResolverImpl.getDefaultResolver());
+ if (Globals.IS_SECURITY_ENABLED) {
+ functionMapper = new FunctionMapper() {
+ public Method resolveFunction(String prefix, String localName) {
+ return null;
+ }
+ };
+ } else {
+ functionMapper = NullFunctionMapper;
+ }
}
public ELContextImpl(ELResolver resolver) {
Modified: trunk/java/org/apache/jasper/el/ELResolverImpl.java
===================================================================
--- trunk/java/org/apache/jasper/el/ELResolverImpl.java 2009-02-16 17:52:55 UTC (rev 937)
+++ trunk/java/org/apache/jasper/el/ELResolverImpl.java 2009-02-23 13:56:06 UTC (rev 938)
@@ -32,115 +32,130 @@
import javax.el.ResourceBundleELResolver;
import javax.servlet.jsp.el.VariableResolver;
+import org.apache.catalina.Globals;
+
public final class ELResolverImpl extends ELResolver {
-
- public final static ELResolver DefaultResolver = new CompositeELResolver();
+ /** @deprecated - Use getDefaultResolver(). Needs to be made private */
+ public final static ELResolver DefaultResolver = new CompositeELResolver();
- static {
- ((CompositeELResolver) DefaultResolver).add(new MapELResolver());
- ((CompositeELResolver) DefaultResolver).add(new ResourceBundleELResolver());
- ((CompositeELResolver) DefaultResolver).add(new ListELResolver());
- ((CompositeELResolver) DefaultResolver).add(new ArrayELResolver());
- ((CompositeELResolver) DefaultResolver).add(new BeanELResolver());
- }
+ static {
+ ((CompositeELResolver) DefaultResolver).add(new MapELResolver());
+ ((CompositeELResolver) DefaultResolver).add(new ResourceBundleELResolver());
+ ((CompositeELResolver) DefaultResolver).add(new ListELResolver());
+ ((CompositeELResolver) DefaultResolver).add(new ArrayELResolver());
+ ((CompositeELResolver) DefaultResolver).add(new BeanELResolver());
+ }
- private final VariableResolver variableResolver;
+ private final VariableResolver variableResolver;
- public ELResolverImpl(VariableResolver variableResolver) {
- this.variableResolver = variableResolver;
- }
+ public ELResolverImpl(VariableResolver variableResolver) {
+ this.variableResolver = variableResolver;
+ }
- public Object getValue(ELContext context, Object base, Object property)
- throws NullPointerException, PropertyNotFoundException, ELException {
- if (context == null) {
- throw new NullPointerException();
- }
+ public Object getValue(ELContext context, Object base, Object property)
+ throws NullPointerException, PropertyNotFoundException, ELException {
+ if (context == null) {
+ throw new NullPointerException();
+ }
- if (base == null) {
- context.setPropertyResolved(true);
- if (property != null) {
- try {
- return this.variableResolver.resolveVariable(property
- .toString());
- } catch (javax.servlet.jsp.el.ELException e) {
- throw new ELException(e.getMessage(), e.getCause());
- }
- }
- }
+ if (base == null) {
+ context.setPropertyResolved(true);
+ if (property != null) {
+ try {
+ return this.variableResolver.resolveVariable(property
+ .toString());
+ } catch (javax.servlet.jsp.el.ELException e) {
+ throw new ELException(e.getMessage(), e.getCause());
+ }
+ }
+ }
- if (!context.isPropertyResolved()) {
- return DefaultResolver.getValue(context, base, property);
- }
- return null;
- }
+ if (!context.isPropertyResolved()) {
+ return getDefaultResolver().getValue(context, base, property);
+ }
+ return null;
+ }
- public Class<?> getType(ELContext context, Object base, Object property)
- throws NullPointerException, PropertyNotFoundException, ELException {
- if (context == null) {
- throw new NullPointerException();
- }
+ public Class<?> getType(ELContext context, Object base, Object property)
+ throws NullPointerException, PropertyNotFoundException, ELException {
+ if (context == null) {
+ throw new NullPointerException();
+ }
- if (base == null) {
- context.setPropertyResolved(true);
- if (property != null) {
- try {
- Object obj = this.variableResolver.resolveVariable(property
- .toString());
- return (obj != null) ? obj.getClass() : null;
- } catch (javax.servlet.jsp.el.ELException e) {
- throw new ELException(e.getMessage(), e.getCause());
- }
- }
- }
+ if (base == null) {
+ context.setPropertyResolved(true);
+ if (property != null) {
+ try {
+ Object obj = this.variableResolver.resolveVariable(property
+ .toString());
+ return (obj != null) ? obj.getClass() : null;
+ } catch (javax.servlet.jsp.el.ELException e) {
+ throw new ELException(e.getMessage(), e.getCause());
+ }
+ }
+ }
- if (!context.isPropertyResolved()) {
- return DefaultResolver.getType(context, base, property);
- }
- return null;
- }
+ if (!context.isPropertyResolved()) {
+ return getDefaultResolver().getType(context, base, property);
+ }
+ return null;
+ }
- public void setValue(ELContext context, Object base, Object property,
- Object value) throws NullPointerException,
- PropertyNotFoundException, PropertyNotWritableException,
- ELException {
- if (context == null) {
- throw new NullPointerException();
- }
+ public void setValue(ELContext context, Object base, Object property,
+ Object value) throws NullPointerException,
+ PropertyNotFoundException, PropertyNotWritableException,
+ ELException {
+ if (context == null) {
+ throw new NullPointerException();
+ }
- if (base == null) {
- context.setPropertyResolved(true);
- throw new PropertyNotWritableException(
- "Legacy VariableResolver wrapped, not writable");
- }
+ if (base == null) {
+ context.setPropertyResolved(true);
+ throw new PropertyNotWritableException(
+ "Legacy VariableResolver wrapped, not writable");
+ }
- if (!context.isPropertyResolved()) {
- DefaultResolver.setValue(context, base, property, value);
- }
- }
+ if (!context.isPropertyResolved()) {
+ getDefaultResolver().setValue(context, base, property, value);
+ }
+ }
- public boolean isReadOnly(ELContext context, Object base, Object property)
- throws NullPointerException, PropertyNotFoundException, ELException {
- if (context == null) {
- throw new NullPointerException();
- }
+ public boolean isReadOnly(ELContext context, Object base, Object property)
+ throws NullPointerException, PropertyNotFoundException, ELException {
+ if (context == null) {
+ throw new NullPointerException();
+ }
- if (base == null) {
- context.setPropertyResolved(true);
- return true;
- }
+ if (base == null) {
+ context.setPropertyResolved(true);
+ return true;
+ }
- return DefaultResolver.isReadOnly(context, base, property);
- }
+ return getDefaultResolver().isReadOnly(context, base, property);
+ }
- public Iterator<java.beans.FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
- return DefaultResolver.getFeatureDescriptors(context, base);
- }
+ public Iterator<java.beans.FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
+ return getDefaultResolver().getFeatureDescriptors(context, base);
+ }
- public Class<?> getCommonPropertyType(ELContext context, Object base) {
- if (base == null) {
- return String.class;
- }
- return DefaultResolver.getCommonPropertyType(context, base);
- }
+ public Class<?> getCommonPropertyType(ELContext context, Object base) {
+ if (base == null) {
+ return String.class;
+ }
+ return getDefaultResolver().getCommonPropertyType(context, base);
+ }
+ public static ELResolver getDefaultResolver() {
+ if (Globals.IS_SECURITY_ENABLED) {
+ ELResolver defaultResolver = new CompositeELResolver();
+ ((CompositeELResolver) defaultResolver).add(new MapELResolver());
+ ((CompositeELResolver) defaultResolver).add(new ResourceBundleELResolver());
+ ((CompositeELResolver) defaultResolver).add(new ListELResolver());
+ ((CompositeELResolver) defaultResolver).add(new ArrayELResolver());
+ ((CompositeELResolver) defaultResolver).add(new BeanELResolver());
+ return defaultResolver;
+ } else {
+ return DefaultResolver;
+ }
+ }
}
Modified: trunk/java/org/apache/jasper/el/ExpressionEvaluatorImpl.java
===================================================================
--- trunk/java/org/apache/jasper/el/ExpressionEvaluatorImpl.java 2009-02-16 17:52:55 UTC (rev 937)
+++ trunk/java/org/apache/jasper/el/ExpressionEvaluatorImpl.java 2009-02-23 13:56:06 UTC (rev 938)
@@ -16,7 +16,6 @@
*/
package org.apache.jasper.el;
-import javax.el.ELContext;
import javax.el.ExpressionFactory;
import javax.el.ValueExpression;
import javax.servlet.jsp.el.ELException;
@@ -29,30 +28,31 @@
public final class ExpressionEvaluatorImpl extends ExpressionEvaluator {
- private final ExpressionFactory factory;
-
- public ExpressionEvaluatorImpl(ExpressionFactory factory) {
- this.factory = factory;
- }
+ private final ExpressionFactory factory;
+
+ public ExpressionEvaluatorImpl(ExpressionFactory factory) {
+ this.factory = factory;
+ }
- public Expression parseExpression(String expression, Class expectedType,
- FunctionMapper fMapper) throws ELException {
- try {
- ELContextImpl ctx = new ELContextImpl(ELResolverImpl.DefaultResolver);
+ public Expression parseExpression(String expression, Class expectedType,
+ FunctionMapper fMapper) throws ELException {
+ try {
+ ELContextImpl ctx =
+ new ELContextImpl(ELResolverImpl.getDefaultResolver());
if (fMapper != null) {
ctx.setFunctionMapper(new FunctionMapperImpl(fMapper));
}
- ValueExpression ve = this.factory.createValueExpression(ctx, expression, expectedType);
- return new ExpressionImpl(ve);
- } catch (javax.el.ELException e) {
- throw new ELParseException(e.getMessage());
- }
- }
+ ValueExpression ve = this.factory.createValueExpression(ctx, expression, expectedType);
+ return new ExpressionImpl(ve);
+ } catch (javax.el.ELException e) {
+ throw new ELParseException(e.getMessage());
+ }
+ }
- public Object evaluate(String expression, Class expectedType,
- VariableResolver vResolver, FunctionMapper fMapper)
- throws ELException {
- return this.parseExpression(expression, expectedType, fMapper).evaluate(vResolver);
- }
+ public Object evaluate(String expression, Class expectedType,
+ VariableResolver vResolver, FunctionMapper fMapper)
+ throws ELException {
+ return this.parseExpression(expression, expectedType, fMapper).evaluate(vResolver);
+ }
}
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2009-02-16 17:52:55 UTC (rev 937)
+++ trunk/webapps/docs/changelog.xml 2009-02-23 13:56:06 UTC (rev 938)
@@ -22,9 +22,6 @@
<update>
Servlet 3.0 API. (markt, remm)
</update>
- <update>
- NSIS 2.43. (remm)
- </update>
</changelog>
</subsection>
<subsection name="Catalina">
@@ -39,13 +36,41 @@
</subsection>
<subsection name="Coyote">
<changelog>
+ <fix>
+ Remove useless instanceof in the HTTP protocol. (markt)
+ </fix>
</changelog>
</subsection>
</section>
+<section name="JBoss Web 2.1.3.CR1 (remm)">
+ <subsection name="General">
+ <changelog>
+ </changelog>
+ </subsection>
+ <subsection name="Catalina">
+ <changelog>
+ </changelog>
+ </subsection>
+ <subsection name="Coyote">
+ <changelog>
+ </changelog>
+ </subsection>
+ <subsection name="Jasper">
+ <changelog>
+ <fix>
+ EL resolver improvements when using a security manager. (markt)
+ </fix>
+ </changelog>
+ </subsection>
+</section>
+
<section name="JBoss Web 2.1.2.GA (remm)">
<subsection name="General">
<changelog>
+ <update>
+ NSIS 2.43. (remm)
+ </update>
</changelog>
</subsection>
<subsection name="Catalina">
15 years, 10 months
JBossWeb SVN: r937 - tags.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-02-16 12:52:55 -0500 (Mon, 16 Feb 2009)
New Revision: 937
Added:
tags/JBOSSWEB_2_1_2_GA/
Log:
- JBoss Web 2.1.2 GA.
Copied: tags/JBOSSWEB_2_1_2_GA (from rev 936, branches/2.1.x)
15 years, 10 months
JBossWeb SVN: r936 - in trunk: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-02-16 12:27:23 -0500 (Mon, 16 Feb 2009)
New Revision: 936
Modified:
trunk/build.properties.default
trunk/webapps/docs/changelog.xml
Log:
- NSIS 2.43.
Modified: trunk/build.properties.default
===================================================================
--- trunk/build.properties.default 2009-02-16 17:24:50 UTC (rev 935)
+++ trunk/build.properties.default 2009-02-16 17:27:23 UTC (rev 936)
@@ -59,12 +59,12 @@
commons-collections-src.loc=${base-commons.loc}/collections/source/commons-collections-3.2.1-src.tar.gz
# ----- NSIS, version 2.0 or later -----
-nsis.home=${base.path}/nsis-2.41
+nsis.home=${base.path}/nsis-2.43
nsis.exe=${nsis.home}/makensis.exe
nsis.installoptions.dll=${nsis.home}/Plugins/InstallOptions.dll
nsis.nsexec.dll=${nsis.home}/Plugins/nsExec.dll
nsis.nsisdl.dll=${nsis.home}/Plugins/NSISdl.dll
-nsis.loc=${base-sf.loc}/nsis/nsis-2.41.zip
+nsis.loc=${base-sf.loc}/nsis/nsis-2.43.zip
# ----- JBoss Native, version 2.0 or later -----
jbossnative.home=${base.path}/jboss-native-2.0.6
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2009-02-16 17:24:50 UTC (rev 935)
+++ trunk/webapps/docs/changelog.xml 2009-02-16 17:27:23 UTC (rev 936)
@@ -22,6 +22,9 @@
<update>
Servlet 3.0 API. (markt, remm)
</update>
+ <update>
+ NSIS 2.43. (remm)
+ </update>
</changelog>
</subsection>
<subsection name="Catalina">
15 years, 10 months