본문 바로가기
MiddleWare(미들웨어)/JEUS

[JEUS6] JEUS에서 Encoding 설정하기

by wonkidoki 2023. 8. 30.
반응형

- JEUS6은 WEBMain.xml 파일 수정하여 Encoding 설정한다.(Webadmin으로 할 수 있으나 xml 수정이 더 편하다.)

- JEUS7,8 과 동일하게 JVM 옵션을 통해 설정 가능하다.(JEUSMain.xml)

- 수정 후, 해당 Container만 재 기동 하면 된다.

1. JEUSMain.xml JVM 옵션으로 Encoding 설정하기

<engine-container>

<name>erp</name>

<id>1</id>

<!-- HotSpot JVM -->

<command-option>

-Xms512m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=256m

-XX:+DisableExplicitGC -verbose:gc

-Xloggc:/home/tmax/jeus6/logs/gclog/erp_gc.log

-XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintHeapAtGC

-XX:+HeapDumpOnOutOfMemoryError

-XX:HeapDumpPath=/home/tmax/jeus6/logs/dump/

-Dfile.encoding=euc-kr

</command-option>

<engine-command>

<type>servlet</type>

<name>erp</name>

</engine-command>

<sequential-start>true</sequential-start>

<system-logging>

<level>INFO</level>

<handler>

<file-handler>

<name>fileHandler</name>

<valid-day>1</valid-day>

</file-handler>

</handler>

</system-logging>

</engine-container>

2. WEBMain.xml 파일에서 설정하기

Default는 APP에 설정된 Encoding 설정이 되어있다면 우선적으로 적용되고,

설정이 안됐을 경우 JEUS에서 적용시켜주는 설정이다.

Forced는 APP에 설정된 것과 상관없이 강제로 Encoding 적용을 시켜주는 설정이다.

<context-group>

<group-name>MyGroup</group-name>

<webserver-connection>

<http-listener>

<listener-id>http1</listener-id>

<port>8088</port>

<thread-pool>

<min>10</min>

<max>20</max>

<step>1</step>

</thread-pool>

</http-listener>

<webtob-listener>

<listener-id>webtob1</listener-id>

<port>9900</port>

<output-buffer-size>8192</output-buffer-size>

<thread-pool>

<min>30</min>

<max>30</max>

<step>1</step>

<max-idle-time>3600000</max-idle-time>

</thread-pool>

<webtob-address>localhost</webtob-address>

<webtob-home>/jeus/webtob</webtob-home>

<registration-id>MyGroup</registration-id>

</webtob-listener>

</webserver-connection>

<logging>

<access-log>

<handler>

<file-handler>

<name>handler1</name>

<valid-day>1</valid-day>

</file-handler>

</handler>

<use-parent-handlers>false</use-parent-handlers>

</access-log>

</logging>

<encoding>

<request-url-encoding>

<default>UTF-8</default>

<forced>UTF-8</forced>

</request-url-encoding>

<request-encoding>

<default>UTF-8</default>

<forced>UTF-8</forced>

</request-encoding>

<response-encoding>

<default>UTF-8</default>

<forced>UTF-8</forced>

</response-encoding>

</encoding>

</context-group>

1,2 번 방법중 한 가지만 적용하고 해당 Container 재 기동만 하면 된다.