난 봄 보안을 사용하고 그리고 난 내가 나의 새로운 형태의 위치를 가리 할 필요가 있다는 것을 발견했다봄 보안 변경 spring_security_login 양식
기본 로그인 양식을 변경하는 방법을 궁금해하고있다. 모든 로그인 예외 표시가있는 기존 기본 양식의 기존 기능을 유지하려고합니다. 그래서 나는 그것을 처음으로 재현하는 방법을 알아야합니다. 3. 일부 라이브러리를 내 연구에
내가 코드
<%@ taglib prefix='c' uri='http://java.sun.com/jstl/core_rt' %>
<%@ page import="org.springframework.security.ui.AbstractProcessingFilter" %>
<%@ page import="org.springframework.security.ui.webapp.AuthenticationProcessingFilter" %>
<%@ page import="org.springframework.security.AuthenticationException" %>
<html>
<head>
<title>Login</title>
</head>
<body>
<h1>Login</h1>
<c:if test="${not empty param.login_error}">
<font color="red">
Your login attempt was not successful, try again.<br/><br/>
Reason: <c:out value="${SPRING_SECURITY_LAST_EXCEPTION.message}"/>.
</font>
</c:if>
<form name="f" action="<c:url value='j_spring_security_check'/>" method="POST">
<table>
<tr><td>User:</td><td><input type='text' name='j_username' value='<c:if test="${not empty param.login_error}"><c:out value="${SPRING_SECURITY_LAST_USERNAME}"/></c:if>'/></td></tr>
<tr><td>Password:</td><td><input type='password' name='j_password'></td></tr>
<tr><td><input type="checkbox" name="_spring_security_remember_me"></td><td>Don't ask for my password for two weeks</td></tr>
<tr><td colspan='2'><input name="submit" type="submit"></td></tr>
<tr><td colspan='2'><input name="reset" type="reset"></td></tr>
</table>
</form>
</body>
</html>
위해 함께에서
http://www.codercorp.com/blog/spring/security-spring/spring-security-login-logout-form.html
덕분에 그에게 올하지만 코드가 스프링 보안을 위해 잘 작동하지 않는 것 같습니다 경우 오래된 및 나는 그들을 하나씩 교체했다. 아래로 변경합니다.
<%@ page import="org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter" %>
<%@ page import="org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter" %>
<%@ page import="org.springframework.security.core.AuthenticationException" %>
그러나 여전히 로그인 오류를보고하지 않습니다. 내가 뭘 더해야하지?
감사합니다. param.login_error를 실현하지 못하는 것에 대한 내 잘못은 매개 변수에 대한 것입니다. – nokheat