public class BrowserRedirectionFilter
extends org.springframework.web.filter.GenericFilterBean
Filter that enables a redirection in Browser to be able to redirect to pages which contain an anchor in the URL.
The sequence for login is:
<ul> <li>we try to access a page from a URL that may contain a hash to select a specific view (e.g. http://localhost:8080/one/#/TSK/eec1ca80-78a7/browse)</li> <li>Spring detects that we aren’t logged in and creates a redirect to the login page (e.g. /login.jsp)</li> <li>this filter replaces the default redirection with a script that stores the hash before redirecting as Spring requested</li> <li>the hash is stored and we redirect to the login page</li> <li>after login, Spring again creates a redirect to the root page of the application</li> * <li>this filter replaces that redirection with a script that restores the location from the original URL using the hash that we stored earlier</li> <li>the cookie storing the hash is cleared</li> </ul>
The sequence for manual logout is:
<ul> <li>we select logout in the GUI, which performs the Spring logout calling /logout</li> <li>after the successful logout we are redirected back to the application (without a hash)</li> <li>this filter replaces that redirection with a script that restores the location from the original URL (no hash is stored, so this is the base page)</li> <li>the subsequent login proceeds as described above, but using the root application page with no hash</li> </ul>
Constructor and Description |
---|
BrowserRedirectionFilter() |
Modifier and Type | Method and Description |
---|---|
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain) |
void |
setLoginPageUrlPattern(String loginPageUrlPattern) |
public void setLoginPageUrlPattern(String loginPageUrlPattern)
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException
IOException
javax.servlet.ServletException
Copyright © 2010 - 2019 edorasware ag. All Rights Reserved.