Where can I find some sample code that illustrates the best way to
register an AuthenticationListener? It seems that
AuthenticationListenerRegistrar no longer exists. I would prefer to
see how to do it using Spring for configuration instead of INI. Is
there a sample project that illustrates how to do this?
Also, I'm unclear on how to best customize the filter. My web.xml
specifies a DelegatingFilterProxy, which I believe is then utilizing a
ShiroFilterFactoryBean. My intent is to write a custom doFilter method
that excludes certain paths, such as /css, /img, and /js. Should my
custom filter extend some class? And how do I wire up my custom
filter? Do I specify something as the targetBeanName init param?
Alternatively, is there a different, simpler, or better way to EXCLUDE
certain paths from being handled by the ShiroFilter? For instance, is
there a way to do this purely with configuration inside of the web.xml
alone?
Lastly, what does the targetFilterLifecycle init param do?
Here's the pertinent part of my spring ShiroFilter config:
<bean id="ShiroFilter"
class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
<property name="securityManager" ref="securityManager"/>
</bean>
Here are my current filter mappings:
<filter>
<filter-name>HibernateFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
</filter>
<filter>
<filter-name>ShiroFilter</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
<!--
<init-param>
<param-name>targetFilterLifecycle</param-name>
<param-value>true</param-value>
</init-param>
-->
</filter>
<filter>
<filter-name>WicketFilter</filter-name>
<filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
<init-param>
<param-name>applicationFactoryClassName</param-name>
<param-value>org.apache.wicket.spring.SpringWebApplicationFactory</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>HibernateFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>ShiroFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>WicketFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping>
Thanks,
Tauren