springmvc 请求路径有关问题

springmvc 请求路径问题
直接访问主页

http://localhost/ytv/

通过其他访问主页


@RequestMapping("/add")
public ModelAndView add() {
         //添加操作.....
         //返回主页....
return new ModelAndView("/index");



这时候url是
http://localhost/ytv/add

而且刷新重复提交,想找个方法跳转之后url不是之前操作的url。
springmvc url java

------解决方案--------------------
redirect:/index
会调用response.redirect
------解决方案--------------------
response.sendRedirect最终由浏览器重定向到指定的URL,而forward是直接在服务器端转发。
------解决方案--------------------
用ajax也可以解决