use of org.springframework.validation.support.BindingAwareModelMap in project alf.io by alfio-event.
the class ReservationFlowIntegrationTest method assignTicket.
private void assignTicket(String eventName, String reservationIdentifier, String ticketIdentifier, String firstName, String lastName) throws Exception {
UpdateTicketOwnerForm ticketOwnerForm = new UpdateTicketOwnerForm();
ticketOwnerForm.setFirstName(firstName);
ticketOwnerForm.setLastName(lastName);
ticketOwnerForm.setEmail("testmctest@test.com");
ticketOwnerForm.setUserLanguage("en");
Assert.assertTrue(reservationController.assignTicketToPerson(eventName, reservationIdentifier, ticketIdentifier, ticketOwnerForm, Mockito.mock(BindingResult.class), new MockHttpServletRequest(), new BindingAwareModelMap()).endsWith("/success"));
}
use of org.springframework.validation.support.BindingAwareModelMap in project com.revolsys.open by revolsys.
the class WebAnnotationMethodHandlerAdapter method invokeHandlerMethod.
protected ModelAndView invokeHandlerMethod(final HttpServletRequest request, final HttpServletResponse response, final Object handler) throws Exception {
final AnnotationHandlerMethodResolver methodResolver = getMethodResolver(handler);
final WebMethodHandler handlerMethod = methodResolver.resolveHandlerMethod(request);
final ServletWebRequest webRequest = new ServletWebRequest(request, response);
final RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
try {
RequestContextHolder.setRequestAttributes(webRequest);
final ExtendedModelMap implicitModel = new BindingAwareModelMap();
final Object result = handlerMethod.invokeMethod(handler, request, response);
if (result == null) {
return null;
} else {
final ModelAndView mav = getModelAndView(handlerMethod.getMethod(), handler.getClass(), result, implicitModel, webRequest);
return mav;
}
} finally {
RequestContextHolder.setRequestAttributes(requestAttributes);
}
}
Aggregations