我必须用myaccount.htm#box-two
返回地址modelMap
。当我把:"#box-two"
对我来说非常重要:
return new ModelAndView("redirect:myaccount.htm#box-two", modelMap);
它不起作用,我在我的URL中获取了参数:
http://localhost:8080/RestFinderWebApp/mojekonto.htm?nameError=Name+required#box-two
我也尝试过:
return new ModelAndView("myaccount#box-two", modelMap);
但它失败了。
如本文所述,RedirectView
将成为你的朋友:Spring Jsps and Jumping to Anchors