This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "repopulating" Watch "repopulating" New topic
Author

repopulating

mannu sharma
Greenhorn

Joined: May 18, 2005
Posts: 1
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

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="http://www.luckycouple.com" target="_blank" rel="nofollow">luckycouple.com</a>
 
jQuery in Action, 2nd edition
 
subject: repopulating
 
Similar Threads
Display data from database to jsp page.
deploy the bean
During Validations
problem with multipart/form-data
Data across multiple actions