본문 바로가기
TIL/Learn - JSP

response.setContentType("text/html; charset=UTF-8");

by koreashowme 2019. 9. 4.

request.setCharacterEncoding("UTF-8");

 

response.setContentType("text/html; charset=UTF-8"); 

 

// 요청 시 한글 처리
request.setCharacterEncoding("UTF-8");

// 응답 시 한글 처리
response.setContentType("text/html; charset=UTF-8");

 

한글 문자가 깨지므로 setContentType을 사용하여 charset을 UTF-8로 바꿔준다.

'TIL > Learn - JSP' 카테고리의 다른 글

mvc2 FrontController mapping  (0) 2019.09.17
MVC 1  (0) 2019.09.09
PrintWriter out=response.getWriter();  (0) 2019.09.04

comment