Returning custom jsp if my custom validation fails during the spring
security login
I am using Spring 2.5 in my application My application uses Spring
Security for login. It has a class which implements the UserDetailService
and overrides the loadUserByUsernamemethod.
In my loadUserByUsername I am doing an IP validation and if it is not
successful I want to redirect user to a custom JSP page iperror.jsp. How
can I do that? I tried throwing the exception in case of IP validation and
catching the error in web.xml like:
<error-page>
<exception-type>com.salebuild.model.IPNotFoundException</exception-type>
<location>/WEB-INF/errors/ip_activation_required.jsp</location>
</error-page>
But id doesent work. Could anyone suggest how I can return a custom JSP on
my custom exception.
No comments:
Post a Comment