You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Aladar The Dinosaur <al...@telocity.com> on 2002/08/27 03:18:34 UTC

Dyna Form bean properties

Hello,

I'm looking to populate the dyna-form properties back to the form in the
event of a validation failure. It appears that I'll have to use <bean:write
name='key' property='attr' /> tag in the JSP page to assign the values back
into the form fields, but I can't figure out what the name of the bean name
should be. Or, is there another way to do this? If I use plain actionForm
this isn't a problem, since I know the name of the bean. However, this
doesn't seem to work with dynaValidatorForm.

Can someone help?

Thank you,
Scott




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Dyna Form bean properties

Posted by Aladar The Dinosaur <al...@telocity.com>.
GREAT!!. I got it and it works. Thank you.

Scott

----- Original Message -----
From: "Craig R. McClanahan" <cr...@apache.org>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Monday, August 26, 2002 8:41 PM
Subject: Re: Dyna Form bean properties


>
>
> On Mon, 26 Aug 2002, Aladar The Dinosaur wrote:
>
> > Date: Mon, 26 Aug 2002 20:18:34 -0500
> > From: Aladar The Dinosaur <al...@telocity.com>
> > Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>
> > To: struts-user@jakarta.apache.org
> > Subject: Dyna Form bean properties
> >
> > Hello,
> >
> > I'm looking to populate the dyna-form properties back to the form in the
> > event of a validation failure. It appears that I'll have to use
<bean:write
> > name='key' property='attr' /> tag in the JSP page to assign the values
back
> > into the form fields, but I can't figure out what the name of the bean
name
> > should be. Or, is there another way to do this? If I use plain
actionForm
> > this isn't a problem, since I know the name of the bean. However, this
> > doesn't seem to work with dynaValidatorForm.
> >
>
> DynaActionForm is no different from ActionForm in this respect -- the
> property values should already be there for proper redisplay.  To prove
> it, deploy the standard struts-example app and try to log in with invalid
> values (i.e. other than "user" and "pass").  You'll see the form
> redisplayed, along with the error messages, with the username
> pre-initialized to what you entered (passwords are deliberately not
> redisplayed to avoid security risks of someone seeing what you typed when
> viewing the page source).
>
> One thing to watch out for -- if you are using request-scope form beans,
> and you're doing a redirect (instead of a forward), that will not work --
> a redirect causes a second request to occur, so the request scope
> attributes are lost.
>
> > Can someone help?
> >
> > Thank you,
> > Scott
>
> Craig
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Dyna Form bean properties

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Mon, 26 Aug 2002, Aladar The Dinosaur wrote:

> Date: Mon, 26 Aug 2002 20:18:34 -0500
> From: Aladar The Dinosaur <al...@telocity.com>
> Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>
> To: struts-user@jakarta.apache.org
> Subject: Dyna Form bean properties
>
> Hello,
>
> I'm looking to populate the dyna-form properties back to the form in the
> event of a validation failure. It appears that I'll have to use <bean:write
> name='key' property='attr' /> tag in the JSP page to assign the values back
> into the form fields, but I can't figure out what the name of the bean name
> should be. Or, is there another way to do this? If I use plain actionForm
> this isn't a problem, since I know the name of the bean. However, this
> doesn't seem to work with dynaValidatorForm.
>

DynaActionForm is no different from ActionForm in this respect -- the
property values should already be there for proper redisplay.  To prove
it, deploy the standard struts-example app and try to log in with invalid
values (i.e. other than "user" and "pass").  You'll see the form
redisplayed, along with the error messages, with the username
pre-initialized to what you entered (passwords are deliberately not
redisplayed to avoid security risks of someone seeing what you typed when
viewing the page source).

One thing to watch out for -- if you are using request-scope form beans,
and you're doing a redirect (instead of a forward), that will not work --
a redirect causes a second request to occur, so the request scope
attributes are lost.

> Can someone help?
>
> Thank you,
> Scott

Craig


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>