2009년 09월 15일
Struts2 한글처리
** struts2 2.1.6 에서는 프론트 컨트롤러를
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
로 변경하세요
=======================================================================================
방법1) struts.xml
<struts>
<constant name="struts.i18n.encoding" value="euc-kr" />
<constant name="struts.devMode" value="true" />
...
</struts>
방법2) struts.properties
struts.devMode = truestruts.i18n.encoding = euc-kr
방법3) web.xml
<web-app id="WebApp_9" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<filter>
<filter-name>struts</filter-name>
<filter-lass> org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
<init-param>
<param-name>struts.i18n.encoding</param-name>
<param-value>euc-kr</param-value>
</init-param>
<init-param>
<param-name>struts.devMode</param-name>
<param-value>true</param-value>
</init-param>
</filter>
</web-app>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
로 변경하세요
=======================================================================================
방법1) struts.xml
<struts>
<constant name="struts.i18n.encoding" value="euc-kr" />
<constant name="struts.devMode" value="true" />
...
</struts>
방법2) struts.properties
struts.devMode = truestruts.i18n.encoding = euc-kr
방법3) web.xml
<web-app id="WebApp_9" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<filter>
<filter-name>struts</filter-name>
<filter-lass> org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
<init-param>
<param-name>struts.i18n.encoding</param-name>
<param-value>euc-kr</param-value>
</init-param>
<init-param>
<param-name>struts.devMode</param-name>
<param-value>true</param-value>
</init-param>
</filter>
</web-app>
# by | 2009/09/15 11:50 | Struts1/Struts2 | 트랙백 | 덧글(0)


