1
1
/*
2
- * Copyright 2002-2011 the original author or authors.
2
+ * Copyright 2002-2012 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
39
39
* @author Alef Arendsen
40
40
* @since 11.07.2003
41
41
* @see javax.servlet.jsp.el.ExpressionEvaluator#evaluate
42
+ * @deprecated as of Spring 3.2, in favor of the JSP 2.0+ native support
43
+ * for embedded expressions in JSP pages (also applying to tag attributes)
42
44
*/
45
+ @ Deprecated
43
46
public abstract class ExpressionEvaluationUtils {
44
47
45
48
/**
@@ -64,13 +67,9 @@ public abstract class ExpressionEvaluationUtils {
64
67
* containers with web applications declaring Servlet 2.4 or higher in their
65
68
* <code>web.xml</code>. For backwards compatibility, Spring's expression support
66
69
* will remain active for applications declaring Servlet 2.3 or earlier. However,
67
- * on Servlet 2.4/2.5 containers, we can't find out what the application has declared,
68
- * so we'll also fall back to keeping expression support active in such a case.
69
- * <p><b>Recommendations:</b> Explicitly set "springJspExpressionSupport" to "false"
70
- * in order to prevent double evaluation for Servlet 2.4+ based applications.
71
- * On Servlet 3.0 containers, this will be done for you by default by the framework.
72
- * If for some reason you nevertheless want Spring's JSP expression support to be
73
- * active, explicitly set the "springJspExpressionSupport" context-param to "true".
70
+ * on Servlet 2.4/2.5 containers, we can't find out what the application has declared;
71
+ * as of Spring 3.2, we won't activate Spring's expression support at all then since
72
+ * it got deprecated and will be removed in the next iteration of the framework.
74
73
* @param pageContext current JSP PageContext
75
74
* @return <code>true</code> if active (ExpressionEvaluationUtils will actually evaluate expressions);
76
75
* <code>false</code> if not active (ExpressionEvaluationUtils will return given values as-is,
@@ -84,13 +83,13 @@ public static boolean isSpringJspExpressionSupportActive(PageContext pageContext
84
83
}
85
84
if (sc .getMajorVersion () >= 3 ) {
86
85
// We're on a Servlet 3.0+ container: Let's check what the application declares...
87
- if (sc .getEffectiveMajorVersion () > 2 || sc .getEffectiveMinorVersion () > 3 ) {
88
- // Application declares Servlet 2.4+ in its web.xml: JSP 2.0 expressions active.
89
- // Skip our own expression support in order to prevent double evaluation .
90
- return false ;
86
+ if (sc .getEffectiveMajorVersion () == 2 && sc .getEffectiveMinorVersion () < 4 ) {
87
+ // Application declares Servlet 2.3- in its web.xml: JSP 2.0 expressions not active.
88
+ // Activate our own expression support.
89
+ return true ;
91
90
}
92
91
}
93
- return true ;
92
+ return false ;
94
93
}
95
94
96
95
/**
0 commit comments