• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java DefaultWebEnvironment类的典型用法和代码示例

java 8次浏览

本文整理汇总了Java中org.apache.shiro.web.env.DefaultWebEnvironment的典型用法代码示例。如果您正苦于以下问题:Java DefaultWebEnvironment类的具体用法?Java DefaultWebEnvironment怎么用?Java DefaultWebEnvironment使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

DefaultWebEnvironment类属于org.apache.shiro.web.env包,在下文中一共展示了DefaultWebEnvironment类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createEnvironment

点赞 2

import org.apache.shiro.web.env.DefaultWebEnvironment; //导入依赖的package包/类
@Override
protected WebEnvironment createEnvironment(ServletContext sc) {
    DefaultWebEnvironment webEnvironment = (DefaultWebEnvironment) super.createEnvironment(sc);

    webEnvironment.setSecurityManager(securityManager);
    webEnvironment.setFilterChainResolver(filterChainResolver);

    return webEnvironment;
}
 

开发者ID:nebrass,
项目名称:pairing-shiro-javaee7,
代码行数:10,
代码来源:ShiroListener.java

示例2: createEnvironment

点赞 2

import org.apache.shiro.web.env.DefaultWebEnvironment; //导入依赖的package包/类
@Override
protected WebEnvironment createEnvironment(ServletContext sc) {
    WebEnvironment webEnvironment = super.createEnvironment(sc);
    RealmSecurityManager rsm = (RealmSecurityManager) webEnvironment.getSecurityManager();
    HashedCredentialsMatcher hashedCredentialsMatcher = new HashedCredentialsMatcher(HASHING_ALGORITHM);
    hashedCredentialsMatcher.setStoredCredentialsHexEncoded(true);
    jpaRealm.setCredentialsMatcher(hashedCredentialsMatcher);      
    Collection<Realm> realms = rsm.getRealms();
    realms.add(jpaRealm);
    rsm.setRealms(realms);
    ((DefaultWebEnvironment) webEnvironment).setSecurityManager(rsm);
    return webEnvironment;
}
 

开发者ID:felixhusse,
项目名称:bookery,
代码行数:14,
代码来源:CDIAwareShiroEnvironmentLoader.java

示例3: contextInitialized

点赞 2

import org.apache.shiro.web.env.DefaultWebEnvironment; //导入依赖的package包/类
/**
 * 
 * @param event 
 */
@Override
public void contextInitialized(ServletContextEvent event) {
    
    event.getServletContext().setInitParameter(
            ENVIRONMENT_CLASS_PARAM, DefaultWebEnvironment.class.getName());
    
    super.contextInitialized(event);
}
 

开发者ID:arthurgregorio,
项目名称:exemplos,
代码行数:13,
代码来源:ShiroListener.java

示例4: createEnvironment

点赞 2

import org.apache.shiro.web.env.DefaultWebEnvironment; //导入依赖的package包/类
/**
 * 
 * @param servletContext
 * @return 
 */
@Override
protected WebEnvironment createEnvironment(ServletContext servletContext) {
    
    final DefaultWebEnvironment environment = (DefaultWebEnvironment) 
            super.createEnvironment(servletContext);
    
    environment.setSecurityManager(this.webSecurityManager);
    environment.setFilterChainResolver(this.filterChainResolver);
    
    return environment;
}
 

开发者ID:arthurgregorio,
项目名称:exemplos,
代码行数:17,
代码来源:ShiroListener.java

示例5: contextInitialized

点赞 2

import org.apache.shiro.web.env.DefaultWebEnvironment; //导入依赖的package包/类
@Override
public void contextInitialized(ServletContextEvent sce) {
    sce.getServletContext().setInitParameter(ENVIRONMENT_CLASS_PARAM, DefaultWebEnvironment.class.getName());
    super.contextInitialized(sce);
}
 

开发者ID:nebrass,
项目名称:pairing-shiro-javaee7,
代码行数:6,
代码来源:ShiroListener.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)