本文整理汇总了Java中org.apache.shiro.web.filter.mgt.FilterChainManager.addFilter方法的典型用法代码示例。如果您正苦于以下问题:Java FilterChainManager.addFilter方法的具体用法?Java FilterChainManager.addFilter怎么用?Java FilterChainManager.addFilter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.shiro.web.filter.mgt.FilterChainManager
的用法示例。
在下文中一共展示了FilterChainManager.addFilter方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DefaultFilterChainResolver
import org.apache.shiro.web.filter.mgt.FilterChainManager; //导入方法依赖的package包/类
@Inject
public DefaultFilterChainResolver(
Set<FilterChainConfigurator> filterChainConfigurators,
BasicAuthenticationFilter basicAuthenticationFilter) {
super();
FilterChainManager filterChainManager = getFilterChainManager();
filterChainManager.addFilter("authcBasic", basicAuthenticationFilter);
for (FilterChainConfigurator configurator: filterChainConfigurators) {
configurator.configure(filterChainManager);
}
filterChainManager.createChain("/**", "authcBasic");
}
示例2: getFilterChainResolver
import org.apache.shiro.web.filter.mgt.FilterChainManager; //导入方法依赖的package包/类
/**
* @return the default filter chain resolver for this application
*/
@Produces
public FilterChainResolver getFilterChainResolver() {
if (this.filterChainResolver == null) {
final FilterChainManager chainManager = new DefaultFilterChainManager();
chainManager.addFilter("anon", new AnonymousFilter());
chainManager.addFilter("authc", this.configureFormAuthentication());
chainManager.addFilter("perms", new PermissionsAuthorizationFilter());
final PathMatchingFilterChainResolver resolver
= new PathMatchingFilterChainResolver();
chainManager.createChain("/secured/**", "authc");
chainManager.createChain("/index.xhtml", "anon");
resolver.setFilterChainManager(chainManager);
this.filterChainResolver = resolver;
}
return this.filterChainResolver;
}
示例3: FDWebEnvironment
import org.apache.shiro.web.filter.mgt.FilterChainManager; //导入方法依赖的package包/类
public FDWebEnvironment() {
BasicHttpAuthenticationFilter authc = new CorsBasicHttpAuthenticationFilter();
LogoutFilter logout = new LogoutFilter();
logout.setRedirectUrl("http://www.freedomotic.com/");
FilterChainManager fcMan = new DefaultFilterChainManager();
fcMan.addFilter("authc", authc);
fcMan.addFilter("logout", logout);
fcMan.createChain("/auth/logout", "logout");
fcMan.createChain("/v3/**", "authc");
PathMatchingFilterChainResolver resolver = new PathMatchingFilterChainResolver();
resolver.setFilterChainManager(fcMan);
setFilterChainResolver(resolver);
setWebSecurityManager(RestAPIv3.defaultWebSecurityManager);
}
示例4: getFilterChainResolver
import org.apache.shiro.web.filter.mgt.FilterChainManager; //导入方法依赖的package包/类
@Produces
public FilterChainResolver getFilterChainResolver() {
FilterChainResolver filterChainResolver = null;
if (filterChainResolver == null) {
FormAuthenticationFilter authc = new FormAuthenticationFilter();
AnonymousFilter anon = new AnonymousFilter();
UserFilter user = new UserFilter();
authc.setLoginUrl(WebPages.LOGIN_URL);
user.setLoginUrl(WebPages.LOGIN_URL);
FilterChainManager fcMan = new DefaultFilterChainManager();
fcMan.addFilter("authc", authc);
fcMan.addFilter("anon", anon);
fcMan.addFilter("user", user);
fcMan.createChain("/index.html", "anon");
fcMan.createChain("/css/**", "anon");
fcMan.createChain("/api/**", "anon");
fcMan.createChain(WebPages.LOGIN_URL, "authc");
fcMan.createChain("/**", "user");
PathMatchingFilterChainResolver resolver = new PathMatchingFilterChainResolver();
resolver.setFilterChainManager(fcMan);
filterChainResolver = resolver;
}
return filterChainResolver;
}
示例5: registerFilters
import org.apache.shiro.web.filter.mgt.FilterChainManager; //导入方法依赖的package包/类
protected void registerFilters(Map<String, Filter> filters, FilterChainManager manager) {
if (!CollectionUtils.isEmpty(filters)) {
boolean init = getFilterConfig() != null; //only call filter.init if there is a FilterConfig available
for (Map.Entry<String, Filter> entry : filters.entrySet()) {
String name = entry.getKey();
Filter filter = entry.getValue();
manager.addFilter(name, filter, init);
}
}
}
示例6: getFilterChainResolver
import org.apache.shiro.web.filter.mgt.FilterChainManager; //导入方法依赖的package包/类
/**
* @return the default filter chain resolver for this application
*/
@Produces
public FilterChainResolver getFilterChainResolver() {
if (this.filterChainResolver == null) {
final FilterChainManager chainManager = new DefaultFilterChainManager();
chainManager.addFilter("anon", new AnonymousFilter());
chainManager.addFilter("authc", this.configureFormAuthentication());
chainManager.addFilter("perms", new PermissionsAuthorizationFilter());
final PathMatchingFilterChainResolver resolver
= new PathMatchingFilterChainResolver();
chainManager.createChain("/index.xhtml", "anon");
chainManager.createChain("/secured/car/**", "perms[car:access]");
chainManager.createChain("/secured/owner/**", "perms[owner:access]");
chainManager.createChain("/secured/**", "authc");
chainManager.createChain("/api/**", "authcBasic");
resolver.setFilterChainManager(chainManager);
this.filterChainResolver = resolver;
}
return this.filterChainResolver;
}