开发者

Velocity's resourceTool integration with Spring Framework

hey guys, I'm trying to integrate a resourceTool into spring. it worked just fine,only 1 problem, default encoding was ISO-8859-1. so..a bit of research and i came up with 3 possible solutions.

I. add a filter in web.xml : SetCharacterEncodingFilter org.springframework.web.filter.CharacterEncodingFilter encoding UTF-8 forceEncoding true SetCharacterEncodingFilter /*

  1. add a line in the viewresolvers:
  2. manually changing the response's encoding: response.setContentType("text开发者_开发问答/html;charset=UTF-8"); response.setCharacterEncoding("UTF-8"); (set encoding is just making sure as content type also sets the encoding itself)

HOWEVER, as soon as i've done EITHER of those, all my strings turn to gibrish, also no matter to what encoding i change it remains gibrish( only gets worse if anything).

any ideas on how to solve it? anyone? ^_^


You should probably tell Velocity to use UTF-8 also, with the input.encoding and/or output.encoding properties.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜