struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ritvars Rundz─üns <>
Subject Getter in action triggers twice. Bug?
Date Mon, 13 Jul 2009 14:21:11 GMT

I am wondering is this Struts2 ( *2.1.6* ) fw bug, or am i just
misunderstanding something :). I created action mapping witch maps to an
action and passes two args to it from base url (not param part), like this:

        <action name="person-*-*" class="example.Person">
            <param name="cmd">{1}</param>
            <param name="id">{2}</param>


Then i created action, which justs do nothing :), but print something when
setter are called:

    public void setCmd(String cmd) {
        System.out.println( "set:cmd" );
        this.cmd = cmd;
    public String getId() {
        return id;
    public void setId(String id) {
        System.out.println( "set:id" ); = id;
    public String getDum() {
        return dum;
    public void setDum(String dum) {
        System.out.println( "set:dum" );
        this.dum = dum;

Requesting URL
http://localhost:8080/struts_2_test/example/person-view-2?dum=3 gives:

I know that setter is just setter, but this thing really annoys me :). Any
thoughts? Thanks!

View raw message