Probléme de redirection apres login erreur 404
Bonjour à tous
Je suis en train de tester le module spring-security mais aprés le login j'ai ce message Etat HTTP 404 - /projet/j_spring_security_check La ressource demandée :/projet/j_spring_security_check n'est pas disponible.
j'utilise spring-security 3.0.5
voici mon aplication-context-security
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| <?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.3.xsd">
<http auto-config="true">
<intercept-url pattern="/login.jsf*" filters="none"/>
<intercept-url pattern="/**" access="ROLE_Admin,ROLE_chef,ROLE_chef,ROLE_guest" />
<remember-me key="JSFRememberMe"/>
<form-login login-processing-url="/j_spring_security_check" login-page="/login.jsf" default-target-url="/"/>
<session-management>
<concurrency-control max-sessions="1" error-if-maximum-exceeded="true"/>
</session-management>
</http>
<authentication-manager alias="authenticationManager">
<authentication-provider >
<jdbc-user-service data-source-ref="dataSource" users-by-username-query="SELECT User.login AS username, User.password as password, User.enabled as enabled FROM user User where User.login=?"
authorities-by-username-query="SELECT U.login as username, G.name as groupe FROM user U, Groupe G ,user_groupe UG WHERE U.user_id=UG.user_id and G.id_groupe=UG.id_groupe and U.login=?"
role-prefix="ROLE_" />
</authentication-provider>
</authentication-manager>
</beans:beans> |
mon login.xhtml
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j">
<head><h:outputText value="Id_User" /></head>
<body>
<f:view>
<h:form id="loginForm" prependId="false" action="j_spring_security_check">
<h:panelGrid columns="3">
<h:outputLabel value="login" for="login" />
<h:inputText id="login" required="true"/><rich:messages style="color: red;" for="login"/>
<h:outputLabel value="Password:" for="password" />
<h:inputSecret id="password" required="true"/>
<rich:messages style="color: red;" for="password"/>
<h:outputLabel value="Remember me" for="_spring_security_remember_me" />
<h:selectBooleanCheckbox id="_spring_security_remember_me" />
<h:commandButton type="submit" id="logins" value="Login" action="#{loginBean.doLogin}"/>
</h:panelGrid>
</h:form>
</f:view>
</body>
</html> |
loginBean.java
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j">
<head><h:outputText value="Id_User" /></head>
<body>
<f:view>
<h:form id="loginForm" prependId="false" action="j_spring_security_check">
<h:panelGrid columns="3">
<h:outputLabel value="username" for="username" />
<h:inputText id="username" required="true"/><rich:messages style="color: red;" for="username"/>
<h:outputLabel value="Password:" for="password" />
<h:inputSecret id="password" required="true"/>
<rich:messages style="color: red;" for="password"/>
<h:outputLabel value="Remember me" for="rememberMe" />
<h:selectBooleanCheckbox id="rememberMe" />
<h:commandButton type="submit" id="logins" value="Login" action="#{loginBean.doLogin}"/>
</h:panelGrid>
</h:form>
</f:view>
</body>
</html> |
Quelqu'un pourrait'il m'aider svp ?