开发者

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

开发者 https://www.devze.com 2023-01-26 06:01 出处:网络
I need to call st开发者_如何转开发atic method of org.hibernate.Hibernate class. How to do that inelement of flow ?You can use the following Spring EL construct to evaluate static methods:

I need to call st开发者_如何转开发atic method of org.hibernate.Hibernate class. How to do that in element of flow ?


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()"/>
0

精彩评论

暂无评论...
验证码 换一张
取 消