Q&A
@requestParam 이 값을 받아오지를 못합니다.
[자문자답] 아 원인을 찾았습니다... (수정후 loginForm.html) action ="/login" th :object =" ${loginForm} " method ="post" > th :if =" ${#fields.hasGlobalErrors()} " > class ="field-error" th :each =" err : ${#fields.globalErrors()} " th :text =" ${err} " > 전체 오류 메시지 for ="loginId" > 로그인 ID type ="text" id ="loginId" th :field =" *{loginId} " class ="form-control" th :errorclass =" field-error " > class ="field-error" th :errors =" *{loginId} " /> for ="password" > 비밀번호 type ="password" id ="password" th :field =" *{password} " class ="form-control" th :errorclass =" field-error " > class ="field-error" th :errors =" *{password} " /> class ="my-4" > class ="row" > class ="col" > class ="w-100 btn btn-primary btn-lg" type ="submit" > 로그인 class ="col" > class ="w-100 btn btn-secondary btn-lg" onclick =" location . href = 'items.html' " th :onclick =" |location.href='@{/}'| " type ="button" > 취소 제가 개인적으로 loginForm 의 action을 /login 으로 바꾸어주었었습니다. 이 부분이 문제였습니다. 다시 action="~" th:action 으로 수정해주었더니 올바르게 값을 가져오는 것을 확인할 수 있었습니다. + 혹시 저 action 의 차이점이 무엇인지 알 수 있을까요??
- いいね数
- 1
- コメント数
- 1
- 閲覧数
- 599

