File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JForum and the fly likes jforum/admin,save Chinese incorrectly Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JForum
Bookmark "jforum/admin,save Chinese incorrectly" Watch "jforum/admin,save Chinese incorrectly" New topic

jforum/admin,save Chinese incorrectly

xu yongqi

Joined: Aug 17, 2012
Posts: 6
when I use the functions of Admin,it can't save Chinese correctly.
for example:

In jforum servlet,req.getParameter("category_name")="???",but when I use the functions of non-admin,such as createTopic,post,and so on,it can save Chinese correctly.

I think it might be related with 'enctype="multipart/form-data"'.If form has 'enctype="multipart/form-data"',it can save Chinese correctly,if it has not,save wrongly.

A few days ago,it all works well.I don't know why it fails now.
I have already set encoding=UTF-8.
xu yongqi

Joined: Aug 17, 2012
Posts: 6
I find the cause.
I integrated jforum with cas.So I added cas filter in web.xml,then request.getParameter() of Chinese parameter got wrongly.
Then I added a characterEnocdingFilter in web.xml,it included request.setCharacterEncoding("UTF-8")
characterEnocdingFilter is the first filter,cas filter is second,then is jforum own filter.
Now it works all right.
I don't understand why I must add characterEnocdingFilter if I add cas filter.
I agree. Here's the link:
subject: jforum/admin,save Chinese incorrectly
It's not a secret anymore!