Returning custom jsp if my custom validation fails during the spring security login -
i using spring 2.5 in application application uses spring security login. has class implements userdetailservice , overrides loaduserbyusernamemethod.
in loaduserbyusername doing ip validation , if not successful want redirect user custom jsp page iperror.jsp. how can that? tried throwing exception in case of ip validation , catching 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. suggest how can return custom jsp on custom exception.
yuo can try throwing accessdeniedexception , set accessdeniedhandler errorpage property error jsp
Comments
Post a Comment