Struts 2 expression supports the following languages:
- OGNL (Object-Graph Navigation Language), open expression language can easily operate the object attributes;
- JSTL (JSP Standard Tag Library), JSP 2.0 standard integrated expression language;
- Groovy, based on the dynamic language for the Java platform, which has nowadays more popular dynamic languages (such as Python, Ruby and Smarttalk, etc.) from a number of characteristics;
- Velocity, strictly speaking is not an expression language, which is a Java-based template matching engine, has said its good performance than JSP.
Struts 2 default expression language is OGNL, because it has the following several advantages compared to other expression language:
- Supports object method calls, such as xxx.doSomeSpecial () ;
- Static class supports method calls and access the values, format expression for @ [full name of the class (including the package path)] @ [name Method | Value Name], for example: @ @ java.lang.String the format ( '% S foo ',' bar ') or @ @ APP_NAME tutorial.MyConstant ;
- Support and assignment expressions series, such as . Price = 100, Discount = 0.8, calculatePrice () , this expression returns 80;
- Access OGNL context (context OGNL) and the ActionContext;
- Operation collection of objects.
Quoted from: http: //www.blogjava.net/max/archive/2007/04/28/114417.html