I'm using Spring 3.0 along with Spring Security. I've always used the following configuration:
<form-login login-page="/login" authentication-failure-url="/login?error=credentials" default-target-url="/account" login-processing-url="/security_check"/>
So when the user doesn't login correctly, they go to /login. Now I have a login dialog on every page of the site. If they don't login correctly, I don't want them redirecting to /login.. instead I want them returning to the page they are at. I'll them popup that same dialog when I see the error=credentials as a parameter.
So how do I do this?