Alex Rivera | Logout

spring is not redirecting to default target url?

Asked 2011-12-28T15:44:01.690
9

I am using spring security for authentication. authentication is working fine. but after authentication it is not redirecting to the html that have mentioned using default target url in spring security configuration file. i am getting simple message Success. but not the html page that have configured. i have added below line for redirection.

<form-login login-page="/login.jsp" default-target-url="/welcome.html"/>

am i missing anything to configure.

Thanks!

Edit
Report

1 Answer

3

An interesting gotcha here is if the browser requests a resource that requires an authenticated session - e.g. requesting a javascript file which requires the user to be logged in, this would generate a 403 error which if you have error pages configured in spring or web.xml would redirect the user to - however the user would never see this.

Then when the user does log in, the last thing spring thinks the user requested was an error page and so the user gets directed to the error page and not the default page as you configure in spring

answered 2012-10-24T16:12:19.957

Your Answer