use of com.liferay.portletmvc4spring.bind.annotation.ActionMapping in project liferay-blade-samples by liferay.
the class UserController method submitApplicant.
@ActionMapping
public void submitApplicant(@ModelAttribute("user") User user, BindingResult bindingResult, ModelMap modelMap, Locale locale, ActionResponse actionResponse, SessionStatus sessionStatus) {
_localValidatorFactoryBean.validate(user, bindingResult);
if (!bindingResult.hasErrors()) {
if (_logger.isDebugEnabled()) {
_logger.debug("firstName=" + user.getFirstName());
_logger.debug("lastName=" + user.getLastName());
}
MutableRenderParameters mutableRenderParameters = actionResponse.getRenderParameters();
mutableRenderParameters.setValue("javax.portlet.action", "success");
sessionStatus.setComplete();
} else {
bindingResult.addError(new ObjectError("user", _messageSource.getMessage("please-correct-the-following-errors", null, locale)));
}
}
Aggregations