Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Windows 10
- Mac
- Eclipse
- grep
- web.xml
- find
- DB 도메인
- Quartz
- maVen
- port
- 네트워크
- copy-dependencies
- context
- 공통표준용어
- tomcat
- Windows
- Source
- xargs
- netsh
- lsof
- import
- VirtualBox
- profile
- ssh
- IntelliJ
- JavaScript
- bash
- GIT
- resource
- 단축키
Archives
- Today
- Total
develog
tomcat 한글 깨짐 수정 본문
아래 내용의 utf-8 인코딩을 상황에 맞게 수정한다
- utf-8, euc-kr
server.xml 에 추가
- URIEncoding="utf-8"
- useBodyEncodingForURI="true"
<Connector port="8080" maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
debug="0" connectionTimeout="20000" disableUploadTimeout="true"
URIEncoding="utf-8"
useBodyEncodingForURI="true"
/>
web.xml 에 CharacterEncodingFilter 필터 추가
<!-- 스프링 프레임워크 사용하는 경우 -->
<filter>
<filter-name>Set Character Encoding</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>
</filter>
<filter-mapping>
<filter-name>Set Character Encoding</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- 스프링 프레임워크 사용하지 않는 경우 -->
<filter>
<filter-name>Set Character Encoding</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>
</filter>
<filter-mapping>
<filter-name>Set Character Encoding</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
jsp 파일 상단에 추가
<%@ page contentType="text/html; charset=utf-8" %>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
jsp 파일에 추가
// web.xml 에 CharacterEncodingFilter 필터가 없는 경우
// 각 페이지에 추가
request.setCharacterEncoding("utf-8");
Comments