Only if it is mapped to a given path On Sun, Dec 25, 2016 at 2:11 AM, Guofeng Zhang <[email protected]> wrote:
> I did not add "tokenLogout" filter to filterChainDefinitionMap. > If a filter is add to filters, does this mean that it will be invoked for > any request, especially whne the filter overrided onPreHandle()? > > Thanks again. > > On Thu, Dec 22, 2016 at 11:57 PM, Brian Demers <[email protected]> > wrote: > >> We probably need to see more of your example, how are you defining >> your filterChainDefinitionMap ? Which version of Shiro are you using? Do >> you have code you can put on github somewhere? >> >> >> On Wed, Dec 21, 2016 at 6:17 AM, Guofeng Zhang <[email protected]> >> wrote: >> >>> Here it is: >>> @Bean(name = "shiroFilter") >>> public ShiroFilterFactoryBean shiroFilter() { >>> ShiroFilterFactoryBean shiroFilter = new >>> ShiroFilterFactoryBean(); >>> shiroFilter.setSecurityManager(securityManager()); >>> ,,,, >>> Map<String, Filter> filters = new HashMap<>(); >>> .... >>> filters.put("tokenLogout", TokenLogoutFilter()); >>> shiroFilter.setFilters(filters); >>> >>> return shiroFilter; >>> } >>> >>> Thanks for your support very much. >>> >>> Guofeng >>> >>> On Wed, Dec 21, 2016 at 1:26 AM, Brian Demers <[email protected]> >>> wrote: >>> >>>> Can you include your configuration ? >>>> >>>> On Mon, Dec 19, 2016 at 5:43 PM, Guofeng Zhang <[email protected]> >>>> wrote: >>>> >>>>> That's my fault. I should derive from PathMatchingFilter and give it a >>>>> url pattern by setFilterChainDefinitionMap, then it works as expected. >>>>> >>>>> But I still cannot understand why this filter is invoked even if I do >>>>> not add it to filterChainDefinitionMap. >>>>> >>>>> Thanks for your response very much. >>>>> >>>>> Guofeng >>>>> >>>>> >>>> >>> >> >
