再会!
我正在阅读 Manning 的 struts2 书,其中一个主题是使用 OGNL 使用语法访问静态变量 @[fullClassName]@[property or methodCall]
所以我在我的程序上试了一下,我的代码如下:
豆:
public class ContactsBean {
private static int count = 1;
//getter and setter
}
行动:
private ContactsBean contacts;
//getters and setters
JSP:
<s:property value="@com.demo.bean.ContactsBean@count" />
or
<s:property value="@vs@count" /> //valuestack method
但它不起作用。我错过了什么吗?谢谢你。