Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to redirect a url using spring

I'm working on a project using spring, MVC, and implementing webapp-runner. The project used to have a hierarchy like /test/home/index.jsp but using webapp-runner it changed to /home/index.jsp. So, What I need is to support and redirect the old url's with "/test/home/index.jsp" to "/home/index.jsp" so the page doesn't brake in case an old url is used. I will be thankful if anyone can give me a hand.

like image 780
Fred Avatar asked Sep 19 '12 15:09

Fred


1 Answers

 return "redirect:/home/index.jsp";

in your controller that returns viewname, or create a second controller with the required mapping .

like image 173
NimChimpsky Avatar answered Sep 29 '22 11:09

NimChimpsky