It's not a secret anymore!
The moose likes Struts and the fly likes repopulating Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "repopulating" Watch "repopulating" New topic


mannu sharma

Joined: May 18, 2005
Posts: 1

Iam trying to repopulate form fields. I get the data from a database and populate the form bean. I want to update this data, so i need to place them in the fields.

where would i put it in the jsp.

is it in this tag ???
<input type="text".......>

if so what is the correct syntax for calling the field


alan do
Ranch Hand

Joined: Apr 14, 2005
Posts: 354
inside your Action.execute(), do form.set("formFieldName", databaseValue); where 'form' is the local variable refering to the ActionForm to which the action is mapped.

also, you'll want to use the struts-html library to build your form, NOT the old HTML form tags.

-/a<br />certified slacker...yes, my last name is 'do' - <a href="" target="_blank" rel="nofollow"></a>
I agree. Here's the link:
subject: repopulating
It's not a secret anymore!