本文整理了Java中org.springframework.security.web.savedrequest.RequestCache.getMatchingRequest
方法的一些代码示例,展示了RequestCache.getMatchingRequest
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RequestCache.getMatchingRequest
方法的具体详情如下:
包路径:org.springframework.security.web.savedrequest.RequestCache
类名称:RequestCache
方法名:getMatchingRequest
[英]Returns a wrapper around the saved request, if it matches the current request. The saved request should be removed from the cache.
[中]如果保存的请求与当前请求匹配,则返回该请求的包装。保存的请求应从缓存中删除。
代码示例来源:origin: spring-projects/spring-security
@Test
public void getWhenInvokingExceptionHandlingTwiceThenOriginalEntryPointUsed() throws Exception {
this.spring.register(InvokeTwiceDoesNotOverrideConfig.class).autowire();
this.mvc.perform(get("/"));
verify(InvokeTwiceDoesNotOverrideConfig.requestCache)
.getMatchingRequest(any(HttpServletRequest.class), any(HttpServletResponse.class));
}
代码示例来源:origin: apache/servicemix-bundles
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
HttpServletRequest wrappedSavedRequest = requestCache.getMatchingRequest(
(HttpServletRequest) request, (HttpServletResponse) response);
chain.doFilter(wrappedSavedRequest == null ? request : wrappedSavedRequest,
response);
}
代码示例来源:origin: org.craftercms/crafter-security-provider
/**
* Checks if there's a request in the request cache (which means that a previous request was cached). If there's
* one, the request cache creates a new request by merging the saved request with the current request. The new
* request is used through the rest of the processor chain.
*
* @param context the context which holds the current request and response
* @param processorChain the processor chain, used to call the next processor
*/
public void processRequest(RequestContext context, RequestSecurityProcessorChain processorChain) throws Exception {
HttpServletRequest request = context.getRequest();
HttpServletResponse response = context.getResponse();
HttpServletRequest wrappedSavedRequest = requestCache.getMatchingRequest(request, response);
if (wrappedSavedRequest != null) {
logger.debug("A previously saved request was found, and has been merged with the current request");
context.setRequest(wrappedSavedRequest);
}
processorChain.processRequest(context);
}
内容来源于网络,如有侵权,请联系作者删除!