struts2 patchwork

Struts 2 expression supports the following languages:

  1. OGNL (Object-Graph Navigation Language), open expression language can easily operate the object attributes;
  2. JSTL (JSP Standard Tag Library), JSP 2.0 standard integrated expression language;
  3. 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;
  4. 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:

  1. Supports object method calls, such as xxx.doSomeSpecial () ;
  2. 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 ;
  3. Support and assignment expressions series, such as . Price = 100, Discount = 0.8, calculatePrice () , this expression returns 80;
  4. Access OGNL context (context OGNL) and the ActionContext;
  5. Operation collection of objects.

Quoted from: http: //www.blogjava.net/max/archive/2007/04/28/114417.html

 

Published 18 original articles · won praise 16 · views 390 000 +

Guess you like

Origin blog.csdn.net/f_zongjian/article/details/5714685