index.jsp里: <%@ taglib prefix="s" uri="/struts-tags" %>
<s:if test="@org.news.ShowNews@TestIf(3,4) == 7">
ok
</s:if>
org.news.ShowNews里:
package org.news;public class ShowNews {
public int TestIf(int i,int j){
return i+j;
}
}出错:
2010-5-17 17:05:43 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
警告: Could not find method [@org.news.ShowNews@TestIf(3,4) == 7]
怎么解决?
<s:if test="@org.news.ShowNews@TestIf(3,4) == 7">
ok
</s:if>
org.news.ShowNews里:
package org.news;public class ShowNews {
public int TestIf(int i,int j){
return i+j;
}
}出错:
2010-5-17 17:05:43 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
警告: Could not find method [@org.news.ShowNews@TestIf(3,4) == 7]
怎么解决?
在struts.xml<constant name="struts.ognl.allowStaticMethodAccess" value="true"></constant>2.TestIf方法定义错误 public static int TestIf(int i,int j){
return i+j;
}