ssm整合shiro时web。xml中配置filter,tomcat报错

 当我们使用ssm框架整合进行项目开发,使用Shiro作为安全验证管理,在web.xml中配置Shiro过滤器后 启动Tomcat会报错: Error during artifact deployment. See server log for details.

<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
        <property name="securityManager" ref="securityManager"/>
        <property name="loginUrl" value="login.html"/>
        <property name="unauthorizedUrl" value="403.html"/>
        <property name="filterChainDefinitions">
            <value>
                /login.jsp = anon
                /* = authc
            </value>
        </property>
    </bean>
    <!--创建SecurityManager对象-->
    <bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
        <property name="realm" ref="realm"/>
    </bean>
    <!--自定义realm-->
    <bean id="realm" class="com.imooc.realm.CustomRealm">

    </bean>

注意这个地方是DefaultWebSecurityManager,很容易写成DefaultSecurityManager,所以在启动时tomcat会报错,还有就是

猜你喜欢

转载自www.cnblogs.com/bozhengheng/p/12623313.html