【发布时间】:2011-08-02 02:17:49
【问题描述】:
美好的一天!
我正在阅读 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
但它不起作用。我错过了什么吗? 谢谢。
【问题讨论】:
标签: jakarta-ee struts2 ognl