public ActionForward fillPrecedentInformationPostback(ActionMapping mapping, ActionForm actionForm,
HttpServletRequest request, HttpServletResponse response) {
// assuming that when using this method each individual candidacy bean
// extends IndividualCandidacyProcessWithPrecedentDegreeInformationBean
final IndividualCandidacyProcessWithPrecedentDegreeInformationBean bean =
(IndividualCandidacyProcessWithPrecedentDegreeInformationBean) getIndividualCandidacyProcessBean();
request.setAttribute(getIndividualCandidacyProcessBeanName(), bean);
RenderUtils.invalidateViewState();
if (bean.hasPrecedentDegreeType()) {
if (bean.isExternalPrecedentDegreeType()) {
bean.setPrecedentDegreeInformation(new PrecedentDegreeInformationBean());
} else if (bean.hasPrecedentStudentCurricularPlan()) {
createCandidacyPrecedentDegreeInformation(bean, bean.getPrecedentStudentCurricularPlan());
} else {
final List<StudentCurricularPlan> scps = bean.getPrecedentStudentCurricularPlans();
if (scps.size() == 1) {
createCandidacyPrecedentDegreeInformation(bean, scps.iterator().next());
bean.setPrecedentStudentCurricularPlan(scps.iterator().next());
}
}
}
return mapping.findForward("fill-candidacy-information");