struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Musachy Barroso <musa...@gmail.com>
Subject Re: Getter in action triggers twice. Bug?
Date Mon, 13 Jul 2009 15:23:46 GMT
please post this question on the user mailing list.

thanks
musachy

On Mon, Jul 13, 2009 at 7:21 AM, Ritvars Rundzāns<rrundzans@gmail.com> wrote:
> Hi!
>
> 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>
>
>             <result>/example/abc.jsp</result>
>         </action>
>
> 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" );
>         this.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:
> set:cmd
> set:id
> set:cmd
> set:dum
> set:id
>
> I know that setter is just setter, but this thing really annoys me :). Any
> thoughts? Thanks!
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Mime
View raw message