Tapestry: character encoding issue

落花浮王杯 提交于 2019-12-01 21:49:24
martin

It was indeed a misconfiguration of my server. The following addition to my web.xml solved it (of course this should also work with a non-Spring filter).

<filter>
    <filter-name>charsetFilter</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>charsetFilter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

I have tried your test string in Tapestry 5.2.6 and 5.3.0-SNAPSHOT and it worked fine. I was able to persist it to the HSQLDB database and pull it back out as expected.

What version are you using? If you are back in 5.0.x you may need to do something like this: http://wiki.apache.org/tapestry/Tapestry5Utf8Encoding

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!