728x90
반응형
SMALL
27강
username 확인
password는 security에서 알아서 처리
JPA query method
https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#jpa.query-methods.query-creation
30강
세션 정보 확인
31강
시큐리티 태그 라이브러리 - JSP
인증된 정보(세션)의 접근하는 방법
<sec:authorize access="isAuthenticated()">
<sec:authentication property="principal" var="principal"/>
</sec:authorize>
var값만 변경
32강
<button type= "button" onclick="update(${principal.user.id},event)">제출</button>
event

33강
영속성 컨텍스트
영속화
더티체킹
34강
유효성 검사
name, password - ⑴ 서버 - ⑵ DB
⑴ 값 검증
프론트단
유효성 검사
⑵ DB 확인
1번 유저 수정
-> 영속화
-> 1번 유저 없음
<button type= "button" onclick="update(${principal.user.id},event)">제출</button>
submit 버튼이 아닌 일반적인 buttom이기때문에 required 유효성이 먹지 않음
<form id="profileUpdate"" onsubmit="update(${principal.user.id})">
form 태그에 onsubmit 추가
submit 버튼 누르면 action 이동, 주소 안적혀있으면 자기 자신으로 되돌아옴
event.preventDefault();
preventDefault()로 폼태그 액션 막기
-브라우저 통신할 경우 Http 상태코드를 같이 던져주는게 좋음
728x90
반응형
LIST
'Spring Boot > 인스타그램 클론코딩' 카테고리의 다른 글
| 연관관계 개념 (0) | 2022.05.27 |
|---|---|
| 유효성 검사 (0) | 2022.04.07 |
| SecurityConfig, CSRF 토큰 (0) | 2022.03.30 |
| Spring Boot 쿼리스트링, 주소 변수 매핑, HTTP Header, HTTP 요청, 톰캣, JSP, Mustache, HTTP 상태코드 (0) | 2022.03.27 |
댓글