views:

30

answers:

1

I need add two custom filters for FORM_LOGIN_FILTER, e.g.

<custom-filter after="FORM_LOGIN_FILTER" ref="myUsernamePasswordAuthenticationFilter" />
<custom-filter after="FORM_LOGIN_FILTER" ref="myUsernamePasswordAuthenticationFilter2" />

What I expect the filter sequences is:
1. Predefind FORM_LOGIN_FILTER
2. myUsernamePasswordAuthenticationFilter
3. myUsernamePasswordAuthenticationFilter2

But above will cause configuration error. So, anyone knows how to write the right config? Thanks!

A: 

Do this:

<custom-filter after="FORM_LOGIN_FILTER" ref="myUsernamePasswordAuthenticationFilter" />
<custom-filter before="BASIC_AUTH_FILTER" ref="myUsernamePasswordAuthenticationFilter2" />

That should put them where you want them.

Gandalf
Thanks a lot! This could be a nice solution. But what if I want two add two or more custom filters between FORM_LOGIN_FILTER and BASIC_AUTH_FILTER? Is there any solution provided?Thanks again.
Paganini
Feel free to upvote it then ;)
Gandalf