I need to call static method of org.hibernate.Hibernate class. How to do that in element of flow ?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You can use the following Spring EL construct to evaluate static methods:
<evaluate expression="T(org.hibernate.Hibernate).initialize(yourObject)"/>
See the appropriate Spring EL reference part:
http://static.springsource.org/spring/docs/3.2.x/spring-framework-reference/html/expressions.html#expressions-types
回答2:
spring-webflow 2 uses OGNL expressions. OGNL allows for static referencing of fields and methods. To utilize it you would want to use the '@' notations.
First you reference the class (with package). You would want to put an @ before the package and class name and an @ before the method call. With hibernate it would look like
<evaluate expression="@org.hibernate.Hibernate@initialize()"/>