--- Gabriel Sidler <[EMAIL PROTECTED]> wrote:
> Nathan Bubna wrote:
> > 
> I just realize that getForm() is the wrong name anyway. What we are
> asking 
> for the not really the form but rather the bean that contains the
> values 
> entered/to be entered into the form. There may be multiple forms per
> template.
> So, getBean() would probably be a more accurate naming. How about
> this:
> 
>     public ActionForm getBean()
> 
> In a template this would look like this:
> 
> <input typ="text" name="username" value="$form.bean.username">
> 
> For efficiency the recommended use should be:
> 
> #set ($mybean = $form.bean)
> <input typ="text" name="username" value="$mybean.username">
> ...

Since it's exposing the form values, why not use:

    public ActionForm getValue()

This might be more descriptive.  we are exposing it in the view, and
designers might not have a clue what a JavaBean is.   That would give
us:

<input type="text" name="username" value="$form.value.username">


> 
> Note that the form bean is available in the request or session
> attributes already. getBean() isn't really necessary. It just a
> little
> convenience. I kind of like it because if there is a method in the
> API 
> this makes it explicit how to get a hold of the form bean. 
> 

As you say, it's just a convenience, but what a convenient one!  I like
it!

> 
> 
> Gabe
> 

Jim Seach

__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to