Zugriff auf statische Variablen, die mit OGNL in Struts2

Guten Tag!

Ich lese Manning struts2 Buch und ein Thema ist der Zugriff auf die statische variable mit OGNL mit der syntax @[fullClassName]@[property or methodCall]

also versuchte ich es auf mein Programm und mein code ist wie folgt:

BEAN:

public class ContactsBean {

    private static int count = 1;
    //getter and setter
}

HANDLUNG:

private ContactsBean contacts;
//getters and setters

JSP:

   <s:property value="@com.demo.bean.ContactsBean@count" />

or
    <s:property value="@vs@count" />  //valuestack method

aber es funktioniert nicht. Bin ich etwas fehlt?
Danke.

InformationsquelleAutor newbie | 2011-08-02
Schreibe einen Kommentar