isEmpty是一个静态方法,应使用类前缀静态访问。一旦使用OGNL,就必须允许静态方法访问或为该方法编写包装,即
public boolean stringUtilsIsEmpty(String captcha) { return StringUtils.isEmpty(captcha);}然后
ActionContext.getContext().getValueStack().findValue("stringUtilsIsEmpty('dd')");但是,在JSP中,您可以执行
<s:if test="captcha != null && captcha != ''"> do something</s:if>
这样做就像
StringUtils#isEmpty()。



