Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.2.22
-
Component/s: Templating
-
Labels:None
-
Number of attachments :
Description
MVEL attempts to evaluate anything preceded by an @ symbol, whether or not the following text is contained in curly braces. The behaviour doesnt appear to be as described in the documentation.
For example, evaluating the following template causes an error (assuming there is no object called smith in context)...
String template = "my email is john@smith.com";
String result = TemplateInterpreter.evalToString(template, rootObject, map);
However, the documentation at http://mvel.codehaus.org/Templating+Basics says...
"Orb tags are comprised of a preceding @ character, followed by
{...}brackets which contain regular MVEL expressions."
This suggests that curly braces are required for template text to be considered an expression.
Given that @ symbols are extremely common in content i suggest modifying the behaviour to match the documentation, rather then the other way around.