public class SpaSupport
extends java.lang.Object
Error based approach does not influence normal processing: all checks appear only after error appearance (so enabling SPA support will not influence application).
Also, SPA support forcefully sets no cache header for index page (or any route, redirected to index page).
| Constructor and Description |
|---|
SpaSupport(boolean enabled,
java.lang.String rootMapping,
java.lang.String target,
java.lang.String noRedirectRegex) |
| Modifier and Type | Method and Description |
|---|---|
void |
markPossibleSpaRoute(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Simple to check for root page: if current request is already root request then no SPA route could be performed.
|
boolean |
redirect(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
int code)
Perform redirection of SPA into index page (so browser receive index html on spa routing url) if conditions
match.
|
public SpaSupport(boolean enabled,
java.lang.String rootMapping,
java.lang.String target,
java.lang.String noRedirectRegex)
public void markPossibleSpaRoute(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
req - request instanceres - response instancepublic boolean redirect(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
int code)
markPossibleSpaRoute(HttpServletRequest, HttpServletResponse))req - request instanceres - response instancecode - error code (http)