struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Barry Volpe" <str...@childrencare.com>
Subject Re: How to fill textfields from FormBean?
Date Tue, 16 Sep 2003 16:54:50 GMT
Use the form bean in your action something like this:

public ActionForward execute(ActionMapping mapping,
ActionForm form, HttpServletRequest request,HttpServletResponse response)

throws IOException, ServletException {



RegForm form = null;

form = new RegForm();



//The following is an example, pull from your database to fill the text
field parameters.

form.setAddress("34 Road");

form.setName("Mike");

form.setZip("112343");


//Now foward to your form and your text fields will be populated.

Barry


----- Original Message ----- 
From: "Dirk Behrendt" <schnoerk@web.de>
To: <struts-user@jakarta.apache.org>
Sent: Tuesday, September 16, 2003 7:58 AM
Subject: How to fill textfields from FormBean?


> Hello!
>
> I have made a registration JSP (name, address, zip, ....) and I want
> that the user can modify his account.
>
> So I have an action class and a form bean for the registration. Now I
> want to implement an action class which shows the registration JSP and
> fills automatically the textfields with the stored values. The user can
> change the values.
>
> How can I realize it? Is there a possibility to forward the values to
> the JSP?
>
> Dirk
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
>



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


Mime
View raw message