public class RestfulLoginDisabledFilter
extends org.springframework.web.filter.GenericFilterBean
UsernamePasswordAuthenticationFilter.
Created by zhanghaolun on 16/7/5.| Constructor and Description |
|---|
RestfulLoginDisabledFilter() |
| Modifier and Type | Method and Description |
|---|---|
void |
doFilter(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res,
javax.servlet.FilterChain chain) |
protected boolean |
requiresAuthentication(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Indicates whether this filter should attempt to process a login request for the
current invocation.
|
void |
setExceptionHandler(cn.home1.oss.lib.errorhandle.internal.RestfulExceptionHandler exceptionHandler) |
void |
setFilterProcessesUrl(String filterProcessesUrl)
Sets the URL that determines if authentication is required.
|
void |
setPostOnly(boolean postOnly)
Defines whether only HTTP POST requests will be allowed by this filter.
|
void |
setRequiresAuthenticationRequestMatcher(org.springframework.security.web.util.matcher.RequestMatcher requestMatcher) |
public void doFilter(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res,
javax.servlet.FilterChain chain)
throws IOException,
javax.servlet.ServletException
IOExceptionjavax.servlet.ServletExceptionprotected boolean requiresAuthentication(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
It strips any parameters from the "path" section of the request URL (such as the
jsessionid parameter in http://host/myapp/index.html;jsessionid=blah)
before matching against the filterProcessesUrl property.
Subclasses may override for special requirements, such as Tapestry integration.
request - requestresponse - responsetrue if the filter should attempt authentication, false otherwise.public void setFilterProcessesUrl(String filterProcessesUrl)
filterProcessesUrl - filterProcessesUrlpublic final void setRequiresAuthenticationRequestMatcher(org.springframework.security.web.util.matcher.RequestMatcher requestMatcher)
public void setPostOnly(boolean postOnly)
Defaults to true but may be overridden by subclasses.
postOnly - postOnlypublic void setExceptionHandler(cn.home1.oss.lib.errorhandle.internal.RestfulExceptionHandler exceptionHandler)
Copyright © 2017. All rights reserved.