0

I am developing a web in Spring MVC, I have a Form which I want to send Utf-8 characters. I did config and the Form work perfectly with method POST, but when I try with method GET, my Utf-8 characters have something wrong, my form sends 'â' and this is what my controller got : 'â'

I already have encoding-filter in my web.xml and that line in my Jsp:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

So, please let me know what's wrong here.

nemo
  • 61
  • 1
  • 8

2 Answers2

0

The right way to ask the server to send UTF-8 data is to use a Accept-Charset: utf-8 request header, not a Content-Type request header.

Sai prateek
  • 11,842
  • 9
  • 51
  • 66
  • I tried to add attribute `accept-charset="UTF-8"` to my `` tag but still got the same result. – nemo Apr 29 '16 at 04:39
0

Add this property in your pom.xml file

It tells Maven in pom.xml file to build the project with the UTF-8 encoding.

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
...
</properties>
Tahir Hussain Mir
  • 2,506
  • 2
  • 19
  • 26
  • I tried but nothing changes. UTF-8 encoding already worked perfectly with method POST but wrong with GET. – nemo Apr 29 '16 at 08:29