struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tschnei...@apache.org
Subject svn commit: r593839 - /struts/sandbox/trunk/struts2-uel-plugin/src/main/java/org/apache/struts2/uelplugin/UelValueStack.java
Date Sun, 11 Nov 2007 01:40:39 GMT
Author: tschneider
Date: Sat Nov 10 17:40:38 2007
New Revision: 593839

URL: http://svn.apache.org/viewvc?rev=593839&view=rev
Log:
Added fallback to context lookup when a property isn't found

Modified:
    struts/sandbox/trunk/struts2-uel-plugin/src/main/java/org/apache/struts2/uelplugin/UelValueStack.java

Modified: struts/sandbox/trunk/struts2-uel-plugin/src/main/java/org/apache/struts2/uelplugin/UelValueStack.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-uel-plugin/src/main/java/org/apache/struts2/uelplugin/UelValueStack.java?rev=593839&r1=593838&r2=593839&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-uel-plugin/src/main/java/org/apache/struts2/uelplugin/UelValueStack.java
(original)
+++ struts/sandbox/trunk/struts2-uel-plugin/src/main/java/org/apache/struts2/uelplugin/UelValueStack.java
Sat Nov 10 17:40:38 2007
@@ -53,6 +53,7 @@
 	}
 
 	public Object findValue(String expr, Class asType) {
+		String originalExpression = expr;
 		try {
 			if (expr != null && expr.startsWith("#") && !expr.startsWith("#{")) {
 				int firstDot = expr.indexOf('.');
@@ -66,9 +67,6 @@
 					return map.get(value);
 				}
 			}
-			if (context.get(expr) != null) {
-				return context.get(expr);
-			}
 			if ((overrides != null) && overrides.containsKey(expr)) {
 				expr = (String) overrides.get(expr);
 			}
@@ -91,6 +89,9 @@
 			}
 			return retVal;
 		} catch (PropertyNotFoundException e) {
+			if (context.containsKey(originalExpression)) {
+				return context.get(originalExpression);
+			}
 			// property not found
 			return null;
 		} catch (ELException e) {



Mime
View raw message