aka007

person_patient

Feb 28th, 2014
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. protected ModelAndView showForm(HttpServletRequest request, HttpServletResponse response, BindException errors)
  2. throws Exception {
  3. Object person = errors.getTarget();
  4. if (person instanceof Patient) {
  5. Patient patient = (Patient) person;
  6. // Redirect if we are not already in the patient form
  7. if (!getFormView().contains("patient")) {
  8. System.out.println("hie I am inside !getformview .contains patient");
  9. Person person1 = (Person) person;
  10. //return new ModelAndView(new RedirectView("../patients/patient.form?patientId=" + patient.getId()));
  11. return new ModelAndView(new RedirectView("../person/person.form?personId="
  12. + person1.getPersonId().toString()));
  13. }
  14. }
  15.  
  16. return super.showForm(request, response, errors);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment