Usually, you'd either use a built in authentication system, or store a User
object into the session after logging in.  Then your bean write would look
more like this:

<bean:write name="user" property="name" scope="session"/>

If validation failed, you should return to the page specified by the input
attribute of your struts forward.  Inside your jsp, use the <html:errors/>
or to be more current <html:messages/> tags to display the errors.

Alternatively, you could specify your form as session scoped in your struts
config, and then it will remain even after the request is finished.

-----Original Message-----
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Tom
Sent: Friday, April 02, 2004 2:48 PM
To: [EMAIL PROTECTED]
Subject: using <bean:write> before form validated


I have used <bean:write> to print information from a completed form by doing

something like....

Hello <bean:write name="myForm" property="name"/>!

I also wanted to write this property out if the form validation failed but
it 
never outputs anything as struts doesn't save the form in the
request/session. I 
find this strange since it must somehow access the form to fill in the
already 
known values.

Is there any way to change this behaviour?

Thanks.

Tom.


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

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

Reply via email to