public class RetainAnchorFilter
extends org.springframework.web.filter.GenericFilterBean
storeUrlPattern) with a Javascript
page that stores the URL anchor in a cookie, and replaces redirects to URLs that match another pattern (
restoreUrlPattern) with a Javascript page that restores the URL anchor from that cookie. The cookie name
can be set via the attribute cookieName.| Modifier and Type | Class and Description |
|---|---|
private class |
RetainAnchorFilter.RedirectResponseWrapper
HttpServletResponseWrapper that replaces the redirect by appropriate Javascript code.
|
| Modifier and Type | Field and Description |
|---|---|
private String |
cookieName |
private String |
restoreUrlPattern |
private String |
storeUrlPattern |
| Constructor and Description |
|---|
RetainAnchorFilter() |
| Modifier and Type | Method and Description |
|---|---|
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain) |
void |
setCookieName(String cookieName)
Sets the cookie name in which the anchor data should be saved.
|
void |
setRestoreUrlPattern(String restoreUrlPattern)
Sets the url pattern for restoring anchors.
|
void |
setStoreUrlPattern(String storeUrlPattern)
Sets the url pattern for storing anchors.
|
private String storeUrlPattern
private String restoreUrlPattern
private String cookieName
public void setStoreUrlPattern(String storeUrlPattern)
storeUrlPattern - url regular expressionpublic void setRestoreUrlPattern(String restoreUrlPattern)
restoreUrlPattern - url regular expressionpublic void setCookieName(String cookieName)
cookieName - name of the cookiepublic void doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
throws IOException,
javax.servlet.ServletException
IOExceptionjavax.servlet.ServletExceptionCopyright © 2014–2019 devon4j-Team. All rights reserved.