The problem is that when the submit on this last JSP happens, I need to update the employerId field in offenderEmploymentForm. I have the employerId visible in the JSP, but it does no good to pass it to the EmployerAction.save action method, because that class does not have access to the session form offenderEmploymentForm. I can read offenderEmploymentForm.employerId from the JSP -- but how do I write it from the JSP?
I have looked at a variety of methods around this. I thought that I could pass the offenderEmploymentForm using setAttribute in the JSP and getAttribute in the EmployerAction.save method -- but no, Struts 1 cant pass objects, and I really need to to update the existing session offenderEmploymentForm.
Our Struts expert is out sick, and I am running out of strings to Google to solve this.
UPDATE: I found a solution, but it was not very pretty. I now understand how you switch from one action block to another. The trick was to switch from the findEmployer action to the offenderEmployer action, invoking an action method in the offenderEmployer action. Also, request.setParameter("employerId", the Form.getEmployerId()); in the action method from where I was forwarding, and request.getParameter("employerId") in the receiving action method. Ugly.
0 komentar:
Posting Komentar