Stripes will call getThing() when binding thing.x and if it returns null,
only then will it call setThing() with a newly created object. It would then
call getThing() again for thing.y and if it still returns null then it would
call setThing() again. That, of course, isn't what should be happening but
the problem would be in your ActionBean, not in Stripes.

Another possibility is if there are two request parameters named "thing."
Then the setter would be called twice. You might want to use Firebug or
something to see exactly what you're sending to the server.

-Ben

On Thu, Jan 15, 2009 at 8:16 PM, Mike McNally <[email protected]> wrote:

> I've got an action with a bean-valued property:
>
>     private Thing thing;
>     public Thing getThing() { return thing; }
>     public void setThing(final Thing thing) { this.thing = thing; }
>
> On my form, I've got a couple of fields: say "thing.x" and "thing.y".
>
> I notice that when I submit my form, the "setThing()" setter in my
> action is called twice - once, presumably, for "thing.x" and once for
> "thing.y".  That is of course disastrously wrong, as both form
> properties should be set on the same Thing instance.
>
> --
> Turtle, turtle, on the ground,
> Pink and shiny, turn around.
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
> http://p.sf.net/sfu/sf-spreadtheword
> _______________________________________________
> Stripes-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to