I was looking for time to search, and I could not find a clear answer or documentation on this particular method.
I want to redirect to another site, for example stackoverflow.com, using this method ... But I do not know how to do this. Any help would be appreciated.
@RequestMapping(value = "/redirectTravelocity", method = RequestMethod.GET) private ModelAndView processForm() { ModelAndView modelAndView = new ModelAndView( "redirect:stackoverflow.com" ); Map<String, Object> model = modelAndView.getModel(); model.put( "error", "this.is.my.error.code" ); return new ModelAndView( "redirect:stackoverflow.com", model ); }
It does not work, it redirects to my site and it crashes ... I know this is stupid, but I do not know how to do it.
source share