Explain in detail how to solve the problem of garbled code from the foreground to the background of SSM framework

Recently, when I was working on an SSM framework project, I always encountered a problem, that is, when the background receives the Chinese parameters passed by the front end, the parameters are garbled, resulting in frequent failure to execute SQL statements. However, it is strange that it is normal in the test environment and production environment, that is, the local development environment is always so deceptive. How to solve it?

1. It's quite tiring. It's just that you can't pass on Chinese parameters without passing on Chinese. For this, just smile....

2. It's still tiring. If you really have to pass on Chinese, you can forcibly transcode Chinese, as follows:

3. Second, I found the third point before I tried it. As for the second point, those who are interested can try it. This third point is the radical solution. After looking for it for a long time, it turned out to be the configuration problem of Tomcat. Open conf / server under the Tomcat directory XML file, find the following code in the file:

Then please add a sentence "configuring uriencoding =" UTF-8 ", as follows:

It will be perfectly solved here, and benbao's problem will be solved. Ma Ma will no longer worry about my sad mood..

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>