Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

repopulating

 
mannu sharma
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

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

thanks

pranav
 
alan do
Ranch Hand
Posts: 354
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic