views:

141

answers:

2

I want to set custom Post-Login Destinations based on user ROLES in my application. for example : If a form login isn't prompted by an attempt to access a protected resource, I want to show different pages, based on different roles. by using target-url I can't do this. how can I do this by using Spring security ?

+1  A: 

In Spring Security 3.0, you can implement a custom AuthenticationSuccessHandler (usually by extending SavedRequestAwareAuthenticationSuccessHandler), and configure <form-login> to use it with authentication-success-handler-ref attribute.

axtavt
A: 

perfect, you resolved my problem. Thanks

Alex