rss
twitter

Sunday, May 01, 2011

Access Java Static Methods in Struts2 Using OGNL

We can access static methods and static constants of java class using OGNL tags in struts2 , as we do in normal jsp scriptlet.

In OGNL @ tag is used to access static methods and varibles, here is the syntax toaccess the static method.

@classname@methodname(arg)
If using Struts 2.1.x means that you need additional parameter in struts.xml. You need to define the following parameter in struts.xml

struts.ognl.allowStaticMethodAccess=true

Bookmark and Share

0 comments:

Post a Comment

  © Blogger templates by Ourblogtemplates.com updated with zenplate.com tips

Back to TOP