 <p>OGNL allows execution of methods, but the static access is disabled by default, so you cannot use static method in expressions. However, you can teach OGNL which classes needs to access the static methods.</p> <blockquote> <h2><a href="https://commons.apache.org/proper/commons-ognl/developer-guide.html#Method_Accessors" rel="nofollow">OGNL developer guide: Method Accessors</a></h2> <p>Method calls are another area where OGNL needs to do lookups for methods based on dynamic information. The <code>MethodAccessor</code> interface provides a hook into how OGNL calls a method. When a static or instance method is requested the implementor of this interface is called to actually execute the method.</p> <pre><code>public interface MethodAccessor { Object callStaticMethod( Map context, Class targetClass, String methodName, List args ) throws MethodFailedException; Object callMethod( Map context, Object target, String methodName, List args ) throws MethodFailedException; } </code></pre> <p>You can set a method accessor on a class-by-class basis using <code>OgnlRuntime.setMethodAccessor()</code>. The is a default method accessor for Object (which simply finds an appropriate method based on method name and argument types and uses reflection to call the method).</p> </blockquote> <hr> <p>You can code something</p> <pre><code>public class StringUtil extends StringUtils implements MethodAccessor { //implement above methods } </code></pre> <hr> <h1>Action class</h1> <pre><code>public static final String MESSAGE = "hello.message"; /** * Field for Message property. */ private String message; /** * Return Message property. * * @return Message property */ public String getMessage() { return message; } private StringUtil stringUtil = new StringUtil(); public StringUtil getStringUtil() { return stringUtil; } public String execute() throws Exception { setMessage(getText(MESSAGE)); OgnlRuntime.setMethodAccessor(StringUtil.class, stringUtil); return SUCCESS; } </code></pre> <hr> <h1>In JSP</h1> <pre class="lang-jsp prettyprint-override"><code>&lt;s:if test="!stringUtil.isEmpty(message)"&gt; &lt;h2&gt;&lt;s:property value="message"/&gt;&lt;/h2&gt; &lt;/s:if&gt; </code></pre> <hr>