code: public void redirectToContextPath(String path) {
          if ("".equals(contextPath)) {
              // context path is the root
              redirect(path);
          } else {
              redirect(contextPath + StringUtils.addStart(path, "/"));
          }
      }
docs: Redirects the browser to a path relative to the application context. For
  example, redirectToContextPath("/contacts") might redirect the browser to
  http://localhost/myContext/contacts
  <p>This method commits the response.</p>
  
  @param path