0
"이 사용자 이름이없는 사용자"를 표시 할 수 있습니까? 컨트롤러를 통해 Spring MVC 프로젝트의 부트 스트랩 모달에 오류 메시지가 표시됩니까?Spring MVC 프로젝트의 부트 스트랩 모달에 오류 메시지 표시
내가 이름을 검증 한
@RequestMapping(value = "/recoverPassword", method = RequestMethod.POST)
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void sendingEmailForForgot(@RequestParam("username") String username) {
// Check whether email exists in DB
System.out.println(userDAO.getUserByName(username));
System.out.println(username);
if (userDAO.getUserByName(username) == null) {
System.out.println("This ID does not exists");
redirectAttributes.addAttribute("error", "wrong");
} else {
System.out.println("mail sent to your id");
}
// If exists then hash and send url link
// else error
}
의 login.jsp
<div class="modal-body">
<form id="register-form" role="form" autocomplete="off" class="form"
method="POST"
action="${pageContext.request.contextPath }/recoverPassword">
<div class="form-group">
<div class="input-group">
<span class="input-group-addon"><i
class="glyphicon glyphicon-envelope color-blue"></i></span> <input
id="email" name="username" placeholder="your username"
class="form-control" type="text"> ${error}
</div>
</div>
<input type="hidden" name="${_csrf.parameterName}"
value="${_csrf.token}" />
<button class="btn btn-lg btn-primary btn-block" type="submit">
Send email link</button>
</form>
컨트롤러 여부 존재하는 경우,하지만 어떻게 같은 현재 열려있는 모달에 해당 오류를 표시합니다 ?
컨트롤러를 통해 가능하지 않은 경우 다른 방법으로 공유하십시오.
난 당신이 현재 열려있는 모달 당신은 안녕 당신이 좀 더 빛을 던질 수 AJAX – Plog
을 통해 그것을 할 필요를 변경하고자한다면 생각? –
웹 서비스에서 응답을 얻지 않고 어떻게 부트 스트랩 모달에서 무엇을 표시 할 수 있습니까? 그리고 스프링의 어떤 버전을 사용하고 있는지가 매우 중요합니다. –