
Originally Posted by
Colin Sampaleanu
All the contextRelative flag does, which should generally be true for almost all uses, is telling Spring that the path is relative to the context. In this case, Spring will itself prepend the context path before sending the request to the sendRedirect(). Note also that how the Servlet container treated urls changed slightly from 2.2 to 2.3+. In 2.2, urls had to be absolute, or relative to the current request, whereas in 2.3, urls which start with / are considered relative to the servlet container root. But in any of these environments, what you probably want to do is set the contextRealtive flag to true, so that your url will be considered relative to the context root, not the servlet root. Your url in this case should start with /.