1. server.xml 수정

톰캣의 server.xml 의 connector 태그의 옵션에 URIEncoding을 UTF-8로 변경
해당 파일은 tomcat 디렉토리의 conf 하위에 있습니다.

<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" ............ URIEncoding="UTF-8" // URIEncoding 옵션 추가 />


2. web.xml 에 필터 추가

톰캣의 web.xml 의 filter 태그에 encoding 필터를 추가합니다.
해당 파일은 tomact 디렉토리의 conf 하위에 있습니다.

<filter>
    <filter-name>setCharEncoding</filter-name>
    <filter-class>filters.SetCharacterEncodingFilter</filter-class>
    <init-param>
        <param-name>encoding</param-name>
        <param-value>UTF-8</param-value>
    </init-param>
</filter>
<filter-mapping>
    <filter-name>setCharEncoding</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>



3. JSP 소스파일을 UTF-8 형식으로 저장

울트라 에디트 기준 변환 방법은
*.파일  >> 변환 >> ascii >> utf-8 순서로 변환하시면 됩니다.


4. 파일 상단에 UTF-8 명시

jsp 파일의 상단에 다음과 같이 charset을 utf-8로 명시합니다.


123.jpg

 



5. 톰캣 실행 옵션에 -Dfile.encoding=UTF-8 추가

톰캣 속성에서 java options에 UTF-8을 추가합니다.


 

111222.png

 

 
 
 
 
 
 
 
 

 

 

 

번호 제목 글쓴이 날짜 조회 수
73 [ChatGPT] nginx 에서 jetty 서버로 프록시중 "org.eclipse.jetty.http.BadMessageException: 400: Invalid SNI" 오류 황제낙엽 2024.11.12 1291
72 [phind] jetty 와 tomcat 의 차이점 (성능, 사용성, 선호도) 황제낙엽 2024.10.31 1438
71 jsp 에서 <script> 로 import 한 js 내의 한글이 깨진다 file 황제낙엽 2024.07.14 1481
70 Nginx: 413 – Request Entity Too Large file 황제낙엽 2024.02.17 1187
69 nginx 설치, 실행, SSL 설정, 프록시 설정 황제낙엽 2024.02.04 962
68 [bard] Nginx로 서브 도메인에 따라 내부의 포트만 다르게 실행중인 웹서버들을 라우팅 황제낙엽 2024.02.01 962
67 [Bing] "Apache"와 "Nginx" 의 차이점 황제낙엽 2024.01.31 1055
66 Nginx 에 대하여 황제낙엽 2024.01.18 892
65 "org.apache.tomcat.util.net.SecureNioChannel.getSslEngine()" is null 황제낙엽 2023.06.22 2956
64 windows tomcat 에 Let's Encrypt(SSL) 적용 황제낙엽 2023.06.21 1093
63 AutoSet PHP 버전 업그레이드 (7.2.10 to 7.4.32) 황제낙엽 2022.10.09 1542
62 401 - Unauthorized: Access is denied due to invalid credentials 황제낙엽 2021.08.27 1387
61 iis error - Service Unavailable / HTTP Error 503. The service is unavailable. 황제낙엽 2020.09.23 1739
60 [Bitnami WAMP] 설치후 PHP 설정 황제낙엽 2020.07.23 1631
59 Autoset의 대안 Bitnami WAMP file 황제낙엽 2020.04.01 1034
58 HTTP 오류 403.14 - Forbidden file 황제낙엽 2020.03.04 964
57 바인딩 편집 (사이트 바인딩) file 황제낙엽 2020.03.04 1021
56 웹사이트에서 여러 도메인을 사용하는 방법 황제낙엽 2020.03.04 1387
55 32비트 응용 프로그램 사용 (ASP, C#) file 황제낙엽 2019.10.31 3056
54 [Tomcat 7] org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 15 황제낙엽 2019.10.16 1231