protected ModelAndView handle(HttpServletRequest request,
HttpServletResponse response, Object command, BindException errors)
throws Exception {
// TODO Auto-generated method stub
OAIPMHCommand params = (OAIPMHCommand) command;
Map model=errors.getModel();
model.put("requestParams", params);
model.put("identify", this.identify);
if(errors.getErrorCount()>0){
if(errors.hasFieldErrors("metadataPrefix")){
model.put("error_code", "cannotDisseminateFormat");
model.put("error", "bad metadataPrefix");
return new ModelAndView("error",model);
}
if(errors.hasFieldErrors("verb")){
model.put("error_code", "badVerb");
model.put("error", "no verb was found");
return new ModelAndView("error",model);
}
if(errors.hasFieldErrors("identifier")){
model.put("error_code", "idDoesNotExist");
model.put("error", "no id was found");
return new ModelAndView("error",model);
}
}
Method method=null;
try{
method=this.getClass().getMethod(params.getVerb(), new Class[]{OAIPMHCommand.class, Map.class});
}catch(NoSuchMethodException nsme){
model.put("error_code", "badVerb");
model.put("error", "invalid verb");
return new ModelAndView("error",model);
}catch(NullPointerException e){