Apache Shiro没有配置FilterChainResolver。返回原始的FilterChain

时间:2014-09-29 14:30:02

标签: jsf-2 shiro

我正在配置我的应用程序以使用apache shiro security,但是,我在日志输出中不断获得以下内容:

DEBUG o.a.s.w.servlet.AbstractShiroFilter - No FilterChainResolver configured.  Returning original FilterChain.

我的.ini文件目前看起来像这样:

    [main]
cacheManager = org.apache.shiro.cache.MemoryConstrainedCacheManager
securityManager.cacheManager = $cacheManager

authc = org.apache.shiro.web.filter.authc.BasicHttpAuthenticationFilter

authc.loginUrl = /login.xhtml

[users]
admin = password

[urls]
/login.xhtml = authc
/logout = logout
/secured/** = authc

我的web.xml中的相关片段如下:

<listener>
    <listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
</listener>

<filter>
    <filter-name>ShiroFilter</filter-name>
    <filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class>
</filter>

<filter-mapping>
    <filter-name>ShiroFilter</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>INCLUDE</dispatcher>
    <dispatcher>ERROR</dispatcher>
</filter-mapping>

我在tomcat 7容器上使用Apache Shiro 1.2 奇怪的是,解决这个问题没有太多问题,我忽略了什么?

1 个答案:

答案 0 :(得分:0)

看起来我正在使用空白的shiro.ini文件。我纠正了这一点,现在我可以看到shiro正在捕捉写入URL