如何使用 OGNL 调用操作方法?
helloAction.java
public String getQuote()
{
return "Don't think, just do";
}
success.jsp
<b>quote() :</b> <s:property value="quote()"/> <br>
struts.xml
<action name="greet" class="com.struts2.helloAction" >
<interceptor-ref name="firewallStack"></interceptor-ref>
<result name="SUCCESS">/WEB-INF/resources/success.jsp</result>
<result name="input">/WEB-INF/resources/success.jsp</result>
</action>
quote()
不调用此方法。我正在使用 xwork-2.0.1.jar 和 ognl-2.6.11.jar。