반응형
1. STS 프로젝트 Propertise의 Text File Encoding 설정
프로젝트 우클릭에서 Propertise로 간 후 Text File Encoding이 UTF-8인지 확인해보자
2. web.xml 강제 Encoding
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
3. JSP(View) 파일 Encoding
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
I LOVE JAVA
반응형