Spring Web Flow: How to call static method from <evaluate />?

孤人 提交于 2019-12-05 10:36:18

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

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()"/>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!