Web.xmlでの文字化け対策
Strus2での日本語対応といえば、struts.propertiesのstruts.i18n.encodingプロパティでShift_JISなり指定するのが定番だが、
struts.propertiesに書くことのできる設定値はweb.xmlにも書けるようだ。
web.xmlに、以下のように指定すると、struts.propertiesの定義を
上書きすることができる。
<filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class> <init-param> <param-name>struts.i18n.encoding</param-name> <param-value>Shift_JIS</param-value> </init-param> </filter>