On Jun 5, 2010, at 3:51 PM, Thomas Menke wrote:

> Hi,
> 
> if I have a textfield: <stripes:text name="foo" />, stripes can 
> automatically populate this field with a value. But I don't really 
> understand what it is doing.
> The documentation says that stripes will first look for http Parameters 
> to populate the form. The idea that stripes automatically processes 
> those unchecked values that could come from Kevin knows where (possibly 
> from a user who has been tricked into clicking a certain link) actually 
> scares me, but it works.
> 
> Next "A value on the ActionBean if an ActionBean instance is present" 
> should be checked. Well, that works, but only if the bean class I 
> specified in the <form> element matches the current ActionBean. If I 
> specify a different actionBean:
> <stripes:form beanclass="xyz.www.differentActionBean">
> then it does not work anymore. That was quite hard to figure out that 
> the <stripes:text>-tag's behavior depends on the bean class specified in 
> the form tag they are specified in.
> But what is actually happening there?

The population from the http parameters is actually used by the validation 
system. And by parameters, it really means the request. Specifically, say you 
have a field bound to an Integer, and you put "Fred" in the field. The Binding 
will fail ("Fred" is not a valid integer), and then send you back to the JSP. 
The JSP will see the field in the request, and repopulate it with "Fred". This 
is a great feature. As for spoofing via a fake link, that's what validation is 
for.

The second part is that, yes, it's bound to the Action Bean in the form. But, 
again, this really isn't a problem.

Stripes advocates the "Action first" model for applications. Basically, you 
never see "page.jsp" in your URL, only "Thing.action", and the Action bean 
forwards to the JSP. So, there are few use case where the form actually 
mismatches the action bean.

Regards,

Will Hartung


------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to