Dashboard > OGNL > Home > Calling Static Methods
  OGNL Log In View a printable version of the current page.  
  Calling Static Methods
Added by tm_jee, last edited by Philip Luppens on Jan 04, 2008  (view change) show comment
Labels: 
(None)

You can call a static method using the syntax

@class@method(args)

Eg. @com.opensymphony.example.HelperClass@filter("enabled")

If you leave out class, it defaults to java.lang.Math, to make it easier to call min and max methods. If you specify the class, you must give the fully qualified name.

If you have an instance of a class whose static method you wish to call, you can call the method through the object as if it was an instance method.

If the method name is overloaded, OGNL chooses the right static method to call using the same procedure it uses for overloaded instance methods.

Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature request - Contact Administrators