1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| public class RechercheUnitaireController extends SimpleFormController {
private Log logger = LogFactory.getLog(RechercheUnitaire.class);
private DomainService domainService;
public void setDomainService(DomainService domainService) {
this.domainService = domainService;
}
protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception {
ModelAndView mav = new ModelAndView("/secure/resultat-recherche-unitaire");
List<Personne> personnes = null;
// On récupère les critères de recherche
RechercheUnitaire ru = (RechercheUnitaire)command;
personnes = domainService.recherchePersonnesPourAnimateur(ru.getAnimId());
mav.addObject("personnes", personnes);
return mav;
}
protected Object formBackingObject(HttpServletRequest request) throws Exception {
return new RechercheUnitaire();
}
} |