Re: FormBeans and GET

2002-03-19 Thread jeffhaenn

Rob,
Thanks for the response.  You cleared up a lot of 
questions I had.

Jeff
> 
> - Original Message -
> From: <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, March 20, 2002 2:55 AM
> Subject: FormBeans and GET
> 
> 
> > A couple questions:
> >
> > 1.  On the initial "GET" of a page do you need to
> > explicitly add a FormBean to session with all fields set
> > to "" so it doesn't complain on null values?
> 
> No, you shouldn't have to.  Though for getters for collections that are used
> to populate with html:options you have to initialize.  (See further on in
> post)
> 
> >
> > 2.  When using the  taglib, does the
> > accessor method have to return a collection to create
> > the  tags?  Same for  with
> > booleans?
> 
> Not sure which accessor method your refering to here.
>  should map to
> form bean methods getValues() and getValueLabels() in your form bean and
> if this is what you really want to know yes those two methods must return
> collections.
> 
> >
> > Problem is that the page see the bean in session 'cause
> > it doesn't exist yet, so I get an exception thrown in
> > the taglib whenit tries to access the property.
> 
> I believe the more common solution to this is to forward through an action
> that initializes your
> form bean prior to the jsp form being loaded.
> 
> request ->
> actionFoo (if not initialized populate form bean, else do stuff cause the
> user filled out form) ->
> jsp form (submit) ->
> actionFoo (if not initialized populate form bean else do some stuff cause
> the user filled out form) ->
> jsp result/view  -- end of request --
> 
> > --
> > To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> >
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 

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




Re: FormBeans and GET

2002-03-19 Thread rob


- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 20, 2002 2:55 AM
Subject: FormBeans and GET


> A couple questions:
>
> 1.  On the initial "GET" of a page do you need to
> explicitly add a FormBean to session with all fields set
> to "" so it doesn't complain on null values?

No, you shouldn't have to.  Though for getters for collections that are used
to populate with html:options you have to initialize.  (See further on in
post)

>
> 2.  When using the  taglib, does the
> accessor method have to return a collection to create
> the  tags?  Same for  with
> booleans?

Not sure which accessor method your refering to here.
 should map to
form bean methods getValues() and getValueLabels() in your form bean and
if this is what you really want to know yes those two methods must return
collections.

>
> Problem is that the page see the bean in session 'cause
> it doesn't exist yet, so I get an exception thrown in
> the taglib whenit tries to access the property.

I believe the more common solution to this is to forward through an action
that initializes your
form bean prior to the jsp form being loaded.

request ->
actionFoo (if not initialized populate form bean, else do stuff cause the
user filled out form) ->
jsp form (submit) ->
actionFoo (if not initialized populate form bean else do some stuff cause
the user filled out form) ->
jsp result/view  -- end of request --

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


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




FormBeans and GET

2002-03-19 Thread jeffhaenn

A couple questions:

1.  On the initial "GET" of a page do you need to 
explicitly add a FormBean to session with all fields set 
to "" so it doesn't complain on null values?

2.  When using the  taglib, does the 
accessor method have to return a collection to create 
the  tags?  Same for  with 
booleans?

Problem is that the page see the bean in session 'cause 
it doesn't exist yet, so I get an exception thrown in 
the taglib whenit tries to access the property.  

--
To unsubscribe, e-mail:   
For additional commands, e-mail: