본문 바로가기
개발/tomcat

톰캣 UTF-8 한글설정

by 황태고블린 2021. 12. 13.

1. server.xml 파일의 Connector 부분에 URIEncoding="UTF-8" 추가

 

2. web.xml 파일의 아래부분 주석해제

<filter>
  <filter-name>setCharacterEncodingFilter</filter-name>
  <filter-class>org.apache.catalina.filters.SetCharacterEncodingFilter</filter-class>
  <init-param>
  <param-name>encoding</param-name>
  <param-value>UTF-8</param-value>
  </init-param>
  <async-supported>true</async-supported>
</filter>

<filter-mapping>
  <filter-name>setCharacterEncodingFilter</filter-name>
  <url-pattern>/*</url-pattern>
</filter-mapping>

 

3. 톰캣 Configure 들어가서 Java Option 에 -Dfile.encodeing=UTF-8  추가

댓글