public class PortFilter extends AuthorizationFilter
[filters] port.port = 80 [urls] /some/path/** = port # override for just this path: /another/path/** = port[8080]
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_HTTP_PORT |
static String |
HTTP_SCHEME |
DEFAULT_LOGIN_URL, GET_METHOD, POST_METHOD
appliedPaths, pathMatcher
ALREADY_FILTERED_SUFFIX
filterConfig
Constructor and Description |
---|
PortFilter() |
Modifier and Type | Method and Description |
---|---|
int |
getPort() |
protected String |
getScheme(String requestScheme,
int port) |
protected boolean |
isAccessAllowed(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
Object mappedValue)
Returns
true if the request is allowed to proceed through the filter normally, or false
if the request should be handled by the
onAccessDenied(request,response,mappedValue)
method instead. |
protected boolean |
onAccessDenied(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
Object mappedValue)
Redirects the request to the same exact incoming URL, but with the port listed in the filter's configuration.
|
void |
setPort(int port) |
protected int |
toPort(Object mappedValue) |
getUnauthorizedUrl, onAccessDenied, setUnauthorizedUrl
getLoginUrl, getSubject, isLoginRequest, onPreHandle, redirectToLogin, saveRequest, saveRequestAndRedirectToLogin, setLoginUrl
getPathWithinApplication, isEnabled, pathsMatch, pathsMatch, preHandle, processPathConfig
afterCompletion, cleanup, doFilterInternal, executeChain, postHandle
doFilter, getAlreadyFilteredAttributeName, isEnabled, isEnabled, setEnabled, shouldNotFilter
getName, setName, toStringBuilder
destroy, getFilterConfig, getInitParam, init, onFilterConfigSet, setFilterConfig
getContextAttribute, getContextInitParam, getServletContext, removeContextAttribute, setContextAttribute, setServletContext, toString
public static final int DEFAULT_HTTP_PORT
public static final String HTTP_SCHEME
public PortFilter()
public int getPort()
public void setPort(int port)
protected boolean isAccessAllowed(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, Object mappedValue) throws Exception
AccessControlFilter
true
if the request is allowed to proceed through the filter normally, or false
if the request should be handled by the
onAccessDenied(request,response,mappedValue)
method instead.isAccessAllowed
in class AccessControlFilter
request
- the incoming ServletRequest
response
- the outgoing ServletResponse
mappedValue
- the filter-specific config value mapped to this filter in the URL rules mappings.true
if the request should proceed through the filter normally, false
if the
request should be processed by this filter's
AccessControlFilter.onAccessDenied(ServletRequest,ServletResponse,Object)
method instead.Exception
- if an error occurs during processing.protected boolean onAccessDenied(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, Object mappedValue) throws IOException
onAccessDenied
in class AccessControlFilter
request
- the incoming ServletRequest
response
- the outgoing ServletResponse
mappedValue
- the config specified for the filter in the matching request's filter chain.false
always to force a redirect.IOException
Copyright © 2004–2019 The Apache Software Foundation. All rights reserved.