本文整理汇总了Java中org.apache.shiro.web.env.IniWebEnvironment类的典型用法代码示例。如果您正苦于以下问题:Java IniWebEnvironment类的具体用法?Java IniWebEnvironment怎么用?Java IniWebEnvironment使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IniWebEnvironment类属于org.apache.shiro.web.env包,在下文中一共展示了IniWebEnvironment类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: usersSection
import org.apache.shiro.web.env.IniWebEnvironment; //导入依赖的package包/类
private Section usersSection(ServletContext servletContext) {
if ( !initialized ) {
synchronized (this) {
try {
if ( initialized )
return usersSection;
initialized = true;
IniWebEnvironment env = (IniWebEnvironment)WebUtils.getWebEnvironment(servletContext) ;
usersSection = env.getIni().getSection("users") ;
} catch (Exception ex) {
LoggerFactory.getLogger(getClass()).error("Failed to find the shiro.ini [users] section");
}
}
}
return usersSection ;
}
开发者ID:afs,项目名称:http-digest-auth,代码行数:17,代码来源:DigestHttpAuthenticationFilterIniPassword.java
示例2: setup
import org.apache.shiro.web.env.IniWebEnvironment; //导入依赖的package包/类
@Override
protected void setup() {
String configFile = getSettings().getString("shiro.configurationFile", "classpath:conf/shiro.ini");
Ini ini = Ini.fromResourcePath(configFile);
IniWebEnvironment webEnvironment = new IniWebEnvironment();
webEnvironment.setIni(ini);
webEnvironment.setServletContext(getServletContext());
webEnvironment.init();
bind(WebEnvironment.class).toInstance(webEnvironment);
bind(SecurityManager.class).toInstance(webEnvironment.getSecurityManager());
bind(WebSecurityManager.class).toInstance(webEnvironment.getWebSecurityManager());
String basePath = Strings.nullToEmpty(getSettings().getString(RestServlet.SETTING_URL, null)).trim();
filter(basePath + "/*").through(ShiroFilter.class);
install(new AopModule());
}
开发者ID:gitblit,项目名称:fathom,代码行数:21,代码来源:ShiroModule.java
示例3: createFilter
import org.apache.shiro.web.env.IniWebEnvironment; //导入依赖的package包/类
/**
* Create the Shiro filter. Overriding this method allows for complete customization of how Shiro is initialized.
*/
protected Filter createFilter(final T configuration) {
ShiroConfiguration shiroConfig = narrow(configuration);
final IniWebEnvironment shiroEnv = new IniWebEnvironment();
shiroEnv.setConfigLocations(shiroConfig.iniConfigs());
shiroEnv.init();
AbstractShiroFilter shiroFilter = new AbstractShiroFilter() {
@Override
public void init() throws Exception {
Collection<Realm> realms = createRealms(configuration);
WebSecurityManager securityManager = realms.isEmpty()
? shiroEnv.getWebSecurityManager()
: new DefaultWebSecurityManager(realms);
setSecurityManager(securityManager);
setFilterChainResolver(shiroEnv.getFilterChainResolver());
}
};
return shiroFilter;
}
开发者ID:silb,项目名称:dropwizard-shiro,代码行数:23,代码来源:ShiroBundle.java
示例4: determineWebEnvironmentClass
import org.apache.shiro.web.env.IniWebEnvironment; //导入依赖的package包/类
protected Class<?> determineWebEnvironmentClass(ServletContext servletContext) {
String className = servletContext.getInitParameter(ENVIRONMENT_CLASS_PARAM);
if (className != null) {
try {
return ClassUtils.forName(className);
} catch (UnknownClassException ex) {
throw new ConfigurationException(
"Failed to load custom WebEnvironment class [" + className + "]", ex);
}
} else {
return IniWebEnvironment.class;
}
}
开发者ID:Teddy-Zhu,项目名称:SilentGo,代码行数:14,代码来源:ShiroLoader.java
注:本文中的org.apache.shiro.web.env.IniWebEnvironment类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论