struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "deepank" <deep...@sasken.com>
Subject Re: initilaizing form bean values
Date Thu, 26 Sep 2002 13:28:55 GMT
I dont know how  this will help.
I have a form with several records, i have an edit buuton for each record.
If a user cliks the edit button i go back to the action class.
here i would like to pick up data from the database, this data i want to
display in the fields of the form(JSP) for the user to edit.
i have this code in the action as usual

if (mapping.getAttribute() != null) {
     if ("request".equals(mapping.getScope()))
      request.removeAttribute(mapping.getAttribute());
     else
      session.removeAttribute(mapping.getAttribute());
   }


this removes the previous form bean instance. SHOULD I REMOVE THIS CODE and
use setter methods to prepopulate the form bean fields
in the action class.

Deepank


----- Original Message -----
From: "Richards, Devin N (Devin)" <devin@lucent.com>
To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
Sent: Thursday, September 26, 2002 6:42 PM
Subject: RE: initilaizing form bean values


> Use the form's reset() method (as described in the docs and examples)
>
> -Devin
>
>
> -----Original Message-----
> From: deepank [mailto:deepank@sasken.com]
> Sent: Thursday, September 26, 2002 9:16 AM
> To: Struts Users Mailing List
> Subject: initilaizing form bean values
>
>
> hi,
>
> i have form bean for which i would like to initialize some fields with
values before displaying the jsp.
>
> for example if i have something like this in my jsp, how can i initialize
this input field from my Action class with a value that i get from the
database
>
>
> <html:text property="mail_id" />, this should display some initial data
>
> any help will be apprecaited
>
> Deepank
>
> --
> To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message