μλ¬ λ©μμ§
ERROR 23820 --- [nio-8080-exec-1] s.e.ErrorMvcAutoConfiguration$StaticView : Cannot render error page for request [/products/0j1k2l3m-4567-89ab-cdef-0123456789jk] and exception [An error happened during template parsing (template: "class path resource [templates//products/detail.html]")] as the response has already been committed. As a result, the response may have the wrong status code.
Java
볡μ¬
νμ
HTML μμ form μ csrf ν ν°μ μΆκ°νλ κ²½μ°μ,
HTML μ΅μλ¨ λΆν° ν ν° input hidden νκ·ΈκΉμ§ μ½λκ° μμ² κΈΈλ©΄, κ·ΈλΆλΆμ ν ν°μ νμνμ§ λͺ»νκ³ κ·Έ μ΄ν μ½λλΆν° μΆλ ₯λμ§ μλ μλ¬κ° λ°μν¨.
ν΄κ²°
head νκ·Έ μμ meta νκ·Έλ‘ HTML μ΅μλ¨λΆν° κ°μ₯ 짧μ μμΉμ csrf ν ν°μ΄ λ±μ₯νκ² νλ©΄ νμμ΄ ν΄κ²°λλ€.
<meta name="_csrf" th:content="${_csrf.token}" />
<meta name="_csrf_header" th:content="${_csrf.headerName}" />
Java
볡μ¬