Page d'erreur pour le login -> renvoi vers la page de login/création de compte complet (loginFull.jsp)
This commit is contained in:
@@ -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">
|
||||||
|
|||||||
@@ -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-->
|
||||||
|
|||||||
18
YACOSWeb/WebContent/WEB-INF/jsp/loginFull.jsp
Normal file
18
YACOSWeb/WebContent/WEB-INF/jsp/loginFull.jsp
Normal 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>
|
||||||
@@ -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>
|
||||||
@@ -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>
|
||||||
@@ -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">
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -21,6 +21,11 @@ body {
|
|||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.errorMessage {
|
||||||
|
color:red;
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
/* @group Login */
|
/* @group Login */
|
||||||
|
|
||||||
#userlogin{
|
#userlogin{
|
||||||
|
|||||||
@@ -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");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user