here is the situation.
I have a page called param.jsp
, it only has a form and a submit button. There is a single record in the database, when the form renders I want to populate the form with that record. When the form is submitted, I want to update that single record and return to the very same page. What would be the best way to do this in struts?
So far, I've come up with this; here is the Action:
class MyAction extends DispatchAction{
public ActionForward savePlatinumJLParam(......){
//<insert the form to the database>
return mapping.findForward("<return to the same page>");
}
public ActionForward initPlatinumJLParam(......){
//<load the form from the database>
//form.setXX(...);
return mapping.findForward("<return to the same page>");
}
}
Saving works just fine, but I'm having trouble with populating the form. Any help is appreciated.