[seam-commits] Seam SVN: r9341 - in trunk: src/main/org/jboss/seam/framework and 1 other directory.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Wed Oct 15 08:41:13 EDT 2008


Author: pete.muir at jboss.org
Date: 2008-10-15 08:41:13 -0400 (Wed, 15 Oct 2008)
New Revision: 9341

Modified:
   trunk/doc/Seam_Reference_Guide/en-US/Framework.xml
   trunk/src/main/org/jboss/seam/framework/Controller.java
Log:
JBSEAM-3487

Modified: trunk/doc/Seam_Reference_Guide/en-US/Framework.xml
===================================================================
--- trunk/doc/Seam_Reference_Guide/en-US/Framework.xml	2008-10-15 12:33:46 UTC (rev 9340)
+++ trunk/doc/Seam_Reference_Guide/en-US/Framework.xml	2008-10-15 12:41:13 UTC (rev 9341)
@@ -373,9 +373,9 @@
         return new Person(country);
     }
     
-    protected String getCreatedMessage() { return "New person #{person.firstName} #{person.lastName} created"; }
-    protected String getUpdatedMessage() { return "Person #{person.firstName} #{person.lastName} updated"; }
-    protected String getDeletedMessage() { return "Person #{person.firstName} #{person.lastName} deleted"; }
+    protected String getCreatedMessage() { return createValueExpression("New person #{person.firstName} #{person.lastName} created"); }
+    protected String getUpdatedMessage() { return createValueExpression("Person #{person.firstName} #{person.lastName} updated"); }
+    protected String getDeletedMessage() { return createValueExpression("Person #{person.firstName} #{person.lastName} deleted"); }
     
 }]]></programlisting>
 

Modified: trunk/src/main/org/jboss/seam/framework/Controller.java
===================================================================
--- trunk/src/main/org/jboss/seam/framework/Controller.java	2008-10-15 12:33:46 UTC (rev 9340)
+++ trunk/src/main/org/jboss/seam/framework/Controller.java	2008-10-15 12:41:13 UTC (rev 9341)
@@ -17,6 +17,7 @@
 import org.jboss.seam.core.Expressions;
 import org.jboss.seam.core.Interpolator;
 import org.jboss.seam.core.Validators;
+import org.jboss.seam.core.Expressions.ValueExpression;
 import org.jboss.seam.faces.FacesMessages;
 import org.jboss.seam.faces.HttpError;
 import org.jboss.seam.faces.Redirect;
@@ -295,7 +296,22 @@
    
    protected <T> T evaluateValueExpression(String expression, Class<T> type)
    {
-       return Expressions.instance().createValueExpression(expression, type).getValue();
+       return createValueExpression(expression, type).getValue();
    }
+   
+   protected Object evaluateValueExpression(String expression)
+   {
+       return createValueExpression(expression).getValue();
+   }
+   
+   protected <T> ValueExpression<T> createValueExpression(String expression, Class<T> type)
+   {
+       return Expressions.instance().createValueExpression(expression, type);
+   }
+   
+   protected ValueExpression createValueExpression(String expression)
+   {
+       return Expressions.instance().createValueExpression(expression, Object.class);
+   }
 
 }




More information about the seam-commits mailing list