本文整理汇总了Java中org.springframework.security.access.intercept.InterceptorStatusToken类的典型用法代码示例。如果您正苦于以下问题:Java InterceptorStatusToken类的具体用法?Java InterceptorStatusToken怎么用?Java InterceptorStatusToken使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
InterceptorStatusToken类属于org.springframework.security.access.intercept包,在下文中一共展示了InterceptorStatusToken类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: invoke
import org.springframework.security.access.intercept.InterceptorStatusToken; //导入依赖的package包/类
public void invoke(FilterInvocation fi) throws IOException,
ServletException {
if ((fi.getRequest() != null) && (fi.getRequest().getAttribute(FILTER_APPLIED) != null) && observeOncePerRequest) {
fi.getChain().doFilter(fi.getRequest(), fi.getResponse());
} else {
if (fi.getRequest() != null) {
fi.getRequest().setAttribute(FILTER_APPLIED, Boolean.TRUE);
}
InterceptorStatusToken token = super.beforeInvocation(fi);
try {
fi.getChain().doFilter(fi.getRequest(), fi.getResponse());
} finally {
super.finallyInvocation(token);
}
super.afterInvocation(token, null);
}
}
示例2: invoke
import org.springframework.security.access.intercept.InterceptorStatusToken; //导入依赖的package包/类
public void invoke(FilterInvocation fi) throws IOException, ServletException {
//fi里面有一个被拦截的url
//里面调用MyInvocationSecurityMetadataSource的getAttributes(Object object)这个方法获取fi对应的所有权限
//再调用MyAccessDecisionManager的decide方法来校验用户的权限是否足够
InterceptorStatusToken token = super.beforeInvocation(fi);
try {
//执行下一个拦截器
fi.getChain().doFilter(fi.getRequest(), fi.getResponse());
} finally {
super.afterInvocation(token, null);
}
}
示例3: invoke
import org.springframework.security.access.intercept.InterceptorStatusToken; //导入依赖的package包/类
private void invoke(FilterInvocation fi) throws IOException, ServletException {
InterceptorStatusToken token = super.beforeInvocation(fi);
try {
fi.getChain().doFilter(fi.getRequest(), fi.getResponse());
} catch (Exception e) {
logger.error(e.getMessage());
} finally {
super.afterInvocation(token, null);
}
}
示例4: invoke
import org.springframework.security.access.intercept.InterceptorStatusToken; //导入依赖的package包/类
public void invoke(FilterInvocation fi) throws IOException, ServletException {
//fi里面有一个被拦截的url
//里面调用MyInvocationSecurityMetadataSource的getAttributes(Object object)这个方法获取fi对应的所有权限
//再调用MyAccessDecisionManager的decide方法来校验用户的权限是否足够
InterceptorStatusToken token = super.beforeInvocation(fi);
try {
//执行下一个拦截器
fi.getChain().doFilter(fi.getRequest(), fi.getResponse());
} finally {
super.afterInvocation(token, null);
}
}
示例5: invoke
import org.springframework.security.access.intercept.InterceptorStatusToken; //导入依赖的package包/类
private void invoke(FilterInvocation fi) throws IOException, ServletException {
//System.out.println("--------------------MaxSecurityFilter invoke--------------");
InterceptorStatusToken token = super.beforeInvocation(fi);
try {
fi.getChain().doFilter(fi.getRequest(), fi.getResponse());
} finally {
super.afterInvocation(token, null);
}
}
示例6: invoke
import org.springframework.security.access.intercept.InterceptorStatusToken; //导入依赖的package包/类
public void invoke(FilterInvocation fi) throws IOException, ServletException {
InterceptorStatusToken token = super.beforeInvocation(fi);
try {
fi.getChain().doFilter(fi.getRequest(), fi.getResponse());
} finally {
super.afterInvocation(token, null);
}
}
示例7: doFilter
import org.springframework.security.access.intercept.InterceptorStatusToken; //导入依赖的package包/类
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
FilterInvocation fi = new FilterInvocation(request, response, chain);
//fi里面有一个被拦截的url
//里面调用MyInvocationSecurityMetadataSource的getAttributes(Object object)这个方法获取fi对应的所有权限
//再调用MyAccessDecisionManager的decide方法来校验用户的权限是否足够
InterceptorStatusToken token = super.beforeInvocation(fi);
try {
//执行下一个拦截器
fi.getChain().doFilter(fi.getRequest(), fi.getResponse());
} finally {
super.afterInvocation(token, null);
}
}
示例8: invoke
import org.springframework.security.access.intercept.InterceptorStatusToken; //导入依赖的package包/类
public void invoke(FilterInvocation fi) throws IOException, ServletException{
InterceptorStatusToken token = super.beforeInvocation(fi);
try{
fi.getChain().doFilter(fi.getRequest(), fi.getResponse());
}finally{
super.afterInvocation(token, null);
}
}
示例9: intercept
import org.springframework.security.access.intercept.InterceptorStatusToken; //导入依赖的package包/类
@Override
public String intercept( ActionInvocation invocation )
throws Exception
{
ActionConfig actionConfig = invocation.getProxy().getConfig();
definitionSourceTag.set( requiredAuthoritiesProvider.createSecurityMetadataSource( actionConfig ) );
InterceptorStatusToken token = beforeInvocation( actionConfig );
addActionAccessResolver( invocation );
Object result = null;
try
{
result = invocation.invoke();
}
finally
{
result = afterInvocation( token, result );
definitionSourceTag.remove();
}
if ( result != null )
{
return result.toString();
}
return null;
}
示例10: preHandle
import org.springframework.security.access.intercept.InterceptorStatusToken; //导入依赖的package包/类
@Override
public boolean preHandle(HttpServletRequest req, HttpServletResponse resp, Object handler) throws Exception {
if (handler instanceof HandlerMethod) {
HandlerInvocation hi = new HandlerInvocation(req, resp, (HandlerMethod) handler);
InterceptorStatusToken token = super.beforeInvocation(hi);
tokenTL.set(token);
}
return true;
}
开发者ID:mateuszwenus,项目名称:spring-security-controller-auth,代码行数:10,代码来源:HandlerSecurityInterceptor.java
示例11: afterCompletion
import org.springframework.security.access.intercept.InterceptorStatusToken; //导入依赖的package包/类
@Override
public void afterCompletion(HttpServletRequest req, HttpServletResponse resp, Object handler, Exception exc) throws Exception {
InterceptorStatusToken token = tokenTL.get();
if (token != null) {
tokenTL.set(null);
super.finallyInvocation(token);
super.afterInvocation(token, null);
}
}
开发者ID:mateuszwenus,项目名称:spring-security-controller-auth,代码行数:10,代码来源:HandlerSecurityInterceptor.java
示例12: invoke
import org.springframework.security.access.intercept.InterceptorStatusToken; //导入依赖的package包/类
private void invoke(FilterInvocation fi) throws IOException, ServletException {
// object为FilterInvocation对象
//super.beforeInvocation(fi);源码
//1.获取请求资源的权限
//执行Collection<ConfigAttribute> attributes = SecurityMetadataSource.getAttributes(object);
//2.是否拥有权限
//this.accessDecisionManager.decide(authenticated, object, attributes);
InterceptorStatusToken token = super.beforeInvocation(fi);
try {
fi.getChain().doFilter(fi.getRequest(), fi.getResponse());
} finally {
super.afterInvocation(token, null);
}
}
示例13: doFilter
import org.springframework.security.access.intercept.InterceptorStatusToken; //导入依赖的package包/类
@Override
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
// 1.获取请求资源的权限
// 2.是否拥有权限
FilterInvocation fi = new FilterInvocation(request, response, chain);
InterceptorStatusToken token = super.beforeInvocation(fi);
try {
fi.getChain().doFilter(fi.getRequest(), fi.getResponse());
} finally {
super.afterInvocation(token, null);
}
}
示例14: invoke
import org.springframework.security.access.intercept.InterceptorStatusToken; //导入依赖的package包/类
/**
* Invoke.
*
* @param fi
* the fi
* @throws IOException
* Signals that an I/O exception has occurred.
* @throws ServletException
* the servlet exception
*/
public void invoke(FilterInvocation fi) throws IOException, ServletException {
log.debug("invoke calling");
InterceptorStatusToken token = super.beforeInvocation(fi);
try {
fi.getChain().doFilter(fi.getRequest(), fi.getResponse());
} finally {
super.afterInvocation(token, null);
}
}