Interface RedirectHelper

All Superinterfaces:
PathHelper
All Known Implementing Classes:
MvcRedirectHelper

public interface RedirectHelper extends PathHelper
A marker interface for redirect helpers. A redirect helper is a PathHelper which constructs paths in such a way that they are suitable for use in Spring's RedirectView (or using the redirect: prefix).

The contract which all implementations of this interface must respect is:

  • the constructed paths MUST NOT include the application context path
  • the constructed paths MUST include any applicable servlet path
  • the constructed paths MUST be absolute (see PathHelper)
  • the constructed paths MUST NOT include the "redirect:" or "forward:" prefix

For example, if the web application context path is /app, and it uses a servlet mapped to /ui, and within this servlet there is an endpoint mapped to /users, then a redirect helper should construct the path to this endpoint as /ui/users, leaving out the application path (/app). This is because in Spring, redirects are by default relative to the application context path.

Since:
10.0
Author:
Petru Galanton