I’m trying to set up spring security, I have a controller which forwards to a login page after valdiation failure. But my interecept does not seem to pick it up…
Contoller fragment:
if (validation not successful) {
return "login";
}
In my xml I have:
<security:intercept-url pattern="/login*" access="ROLE_USER" />
but this fails, I get the following error:
The requested resource (/myapp/WEB-INF/jsp/login.jsp) is not available.
How can I get it to interecept the login forward?
If user is not logged yet, it means he doesn’t have
ROLE_USER, so Spring Security won’t allow to access/login.Add
use-expressions="true"to<http>element and change intercept line to this:Plus, make sure that login.jsp is under
/WEB-INF/jsp/login.jsp.EDIT after comment:
Seem that you have no Spring Security config at all, so begin with this:
or, if you’re using Spring Security 3.1:
Create
/WEB-INF/jsp/login.jspfile with example content:And what’s more, please read about Spring Security, because these are really basics of this framework.