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.
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.xmlstruts.ognl.allowStaticMethodAccess=true
0 comments:
Post a Comment