Page d'erreur pour le login -> renvoi vers la page de login/création de compte complet (loginFull.jsp)

This commit is contained in:
Nicolas Michard
2008-02-04 14:05:45 +00:00
parent e9930c6791
commit af13dfaded
10 changed files with 56 additions and 7 deletions

View File

@@ -32,10 +32,15 @@ http://www.springframework.org/schema/beans http://www.springframework.org/schem
<bean id="authenticationProcessingFilter" class="org.acegisecurity.ui.webapp.AuthenticationProcessingFilter"> <bean id="authenticationProcessingFilter" class="org.acegisecurity.ui.webapp.AuthenticationProcessingFilter">
<property name="authenticationManager" ref="authenticationManager"/> <property name="authenticationManager" ref="authenticationManager"/>
<property name="authenticationFailureUrl" value="/jsp/login.jsp?errorId=1"/> <property name="authenticationFailureUrl" value="/login.htm?login_error=1" />
<property name="defaultTargetUrl" value="/"/> <property name="defaultTargetUrl" value="/"/>
<property name="filterProcessesUrl" value="/j_acegi_security_check"/> <property name="filterProcessesUrl" value="/j_acegi_security_check"/>
<property name="rememberMeServices" ref="rememberMeServices"/> <property name="rememberMeServices" ref="rememberMeServices"/>
<property name="exceptionMappings">
<props>
<prop key="org.acegisecurity.BadCredentialsException">/login.htm?login_error=2</prop>
</props>
</property>
</bean> </bean>
<bean id="authenticationManager" class="org.acegisecurity.providers.ProviderManager"> <bean id="authenticationManager" class="org.acegisecurity.providers.ProviderManager">

View File

@@ -26,7 +26,7 @@
<!-- For anonymous user display the login form --> <!-- For anonymous user display the login form -->
<authz:authorize ifAllGranted="ROLE_ANONYMOUS"> <authz:authorize ifAllGranted="ROLE_ANONYMOUS">
<page:applyDecorator name="empty" page="/WEB-INF/jsp/login.jsp" /> <page:applyDecorator name="empty" page="/login.jsp" />
</authz:authorize> </authz:authorize>
<!-- For authenticated user display user information--> <!-- For authenticated user display user information-->

View File

@@ -0,0 +1,18 @@
<%@ include file="/WEB-INF/decorators/include.jsp"%>
<html>
<head></head>
<body>
<c:if test="${not empty param.login_error}">
<div class="login_error">
Your login attempt was not successful, try again.<br /><br />
</div>
</c:if>
<br /> FORMULAIRE DE CONNEXION
<br /> NOUVEL UTILISATEUR
</body>
</html>

View File

@@ -14,7 +14,7 @@ Utilisateur avec tous les r
<b>Lancer le Filler.java dans YACOS Test pour avoir l'utilisateur admin puis choisir la conference id=68 (ou la premiere de la liste normalement)...</b><br /> <b>Lancer le Filler.java dans YACOS Test pour avoir l'utilisateur admin puis choisir la conference id=68 (ou la premiere de la liste normalement)...</b><br />
LOGIN=<b>admin</b> PASS=<b>admin</b> LOGIN=<b>admin</b> PASS=<b>admin</b><br/>
</body> </body>
</html> </html>

View File

@@ -115,4 +115,5 @@
<location>/WEB-INF/jsp/errors/404error.jsp</location> <location>/WEB-INF/jsp/errors/404error.jsp</location>
</error-page> </error-page>
</web-app> </web-app>

View File

@@ -74,6 +74,9 @@
<prop key="/valideOrReject.htm"> <prop key="/valideOrReject.htm">
ValideOrRejectController ValideOrRejectController
</prop> </prop>
<prop key="/login.htm">
LogonController
</prop>
</props> </props>
</property> </property>
</bean> </bean>
@@ -233,6 +236,9 @@
<property name="articleManager" ref="articleManager" /> <property name="articleManager" ref="articleManager" />
</bean> </bean>
<bean id="LogonController" class="org.yacos.web.system.controller.LogonController">
</bean>
<!-- List all conference --> <!-- List all conference -->
<bean id="ListConferenceController" <bean id="ListConferenceController"
class="org.yacos.web.system.controller.ListConferenceController"> class="org.yacos.web.system.controller.ListConferenceController">

View File

@@ -1,6 +1,5 @@
<%@ include file="/WEB-INF/decorators/include.jsp"%> <%@ include file="/WEB-INF/decorators/include.jsp"%>
<html> <html>
<head></head> <head></head>
<body> <body>

View File

@@ -21,6 +21,11 @@ body {
position: relative; position: relative;
} }
.errorMessage {
color:red;
font-size: 10px;
}
/* @group Login */ /* @group Login */
#userlogin{ #userlogin{

View File

@@ -1,5 +1,20 @@
package org.yacos.web.system.controller; package org.yacos.web.system.controller;
public class LogonController { import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;
public class LogonController implements Controller {
public ModelAndView handleRequest(HttpServletRequest request,
HttpServletResponse response) throws Exception {
// get ID Error
int idError = Integer.parseInt(request.getParameter("login_error"));
request.getSession().setAttribute("login_error",idError);
return new ModelAndView("loginFull");
}
} }