Contents
see Listmultipart/form-data 경우
?${_csrf.parameterName}=${_csrf.token}
일반 form
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
sec:form 의 경우 생략 (다만 로그인 및 로그아웃은 일반 폼으로 지정해야하는 이상한버그)
ajax
<meta name="_csrf" content="${_csrf.token}"/>
<meta name="_csrf_header" content="${_csrf.headerName}"/>
var token = $("meta[name='_csrf']").attr("content");
var header = $("meta[name='_csrf_header']").attr("content");
$.ajax({
type : "POST",
url : '<c:url value="${checkLoginAjax}" />',
data : {
userId : userId
},
beforeSend: function(xhr) {
// here it is
xhr.setRequestHeader(header, token);
},
dataType : "json",
success : function(d){
}
});
사용예시
spring
| No | 작성일 | Title |
|---|---|---|
| 2123 | 2026. 02. 11. | Spring AI: 스프링에서 LLM 통합하기 |
| 2122 | 2026. 02. 11. | Spring Boot 3.4 신기능과 마이그레이션 가이드 |
| 2013 | 2025. 11. 30. | Spring Cache 추상화 - Redis 캐시 적용 |
| 2012 | 2025. 11. 30. | Spring Validation - Bean Validation 활용 |
| 2011 | 2025. 11. 30. | Spring Profile로 환경별 설정 관리 |
| 2010 | 2025. 11. 30. | Spring AOP로 로깅과 트랜잭션 처리 |
| 2009 | 2025. 11. 30. | Spring Batch 대용량 데이터 처리 |
| 2008 | 2025. 11. 30. | Spring Cloud Gateway로 API Gateway 구축 |
| 2007 | 2025. 11. 30. | Spring WebFlux - 리액티브 프로그래밍 입문 |
| 2006 | 2025. 11. 30. | Spring Data JPA 쿼리 메서드 완벽 가이드 |