HTTP Status 400 - Invalid direct reference to form login page type Status report message Invalid direct reference to form login page description The request sent by the client was syntactically incorrect (Invalid direct reference to form login page).
This happens if I try to log in as any of the users defined in my tomcat-users.xml file, as long as I provide a correct username and password. It does not matter whether or not the user has been defined to include the "admin" role. If I use an invalid username or password, I (properly) get a page telling me so, with a link back to the login form to try again. What is configured incorrectly here, and how do I fix it?
If you go directly , with no intermediate page, to the login page , the container will not know where to direct "after". You have to first hit a protected page (like http://localhost:8080/admin) and when it re-directs you to login.jsp, it will know that you then want to go to /admin after a successful login.
When you go directly there and fail, it knows enough to send appropriate error messages and what not, but as soon as you succeed, you will need to have "come from somewhere else" so it knows where to send you next.