I am developing a Spring MVC application and I need to check a specific condition in my controller. If this is true, I should return a status code of 302. This is something like this:
@RequestMapping(value = "/mypath.shtml", method = RequestMethod.GET)
public ModelAndView pageHandler(@Valid MyForm form, BindingResult result, HttpServletRequest request,
Locale locale) throws PageControllerException, InvalidPageContextException, ServiceException {
if (someCondition){
}
else{
}
}
What is the best way to do this?
Thank you in advance
source
share