I've been googling a while and I couldn't find a clear answer or documentation about this specific method.
I want to redirect to another site, like stackoverflow.com using this method... But I don't know how to do it. Any help will 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 doesn't work, it redirects within my site and it crashes... I know this is stupid but I don't know how to do it.
Here is one way to do it:
@RequestMapping(value = "/redirectTravelocity", method = RequestMethod.GET)
private String processForm()
{
return "redirect:http://stackoverflow.com";
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With