Hession Integrated Spring + MAVEN dependent Communication Comm Project + solve @responsebody Chinese garbled

Source: Internet
Author: User

Hessian combined with spring's demo Hessian's maven dependency:<!--Hessian--><dependency> <groupId>com.caucho</groupId> <artifactid>hessian </artifactId> <version>4.0.7</version></dependency> Instance demo:hession integrated Spring + MAVEN dependent Communication Comm Project + address @responsebody Chinese garbled:.... maven relies on the Comm project of the communication.

You need to rely on the parent project of the Comm Project and introduce the following dependencies (corresponding attributes and Comm projects):

<!--Hessian-comm:hessian Communication jar--<dependency> <groupId>com.xxl</groupId> <artifactid& Gt;hessian-comm</artifactid> <version>0.0.1-SNAPSHOT</version> </dependency> after dependency, services can be provided: 1, the use of Comm Project interface interface; 2, using the model models of Comm project; 3, the use of Comm Project Util tool class; 4, join the Comm Project maven dependency package; 5. When the war package is played, the Comm Project will be packaged into a jar and the Comm's Maven dependency package night will be introduced; (manual packaging relies on Comm: Project Right-click "Properties" Deployment Assembly "Add project ... )
Solve @responsebody Chinese garbled characters @RequestMapping (value = "/hello2") @ResponseBody public string Hello2 (model) {return responsebody returns the Chinese string character directly String ", garbled"; } @RequestMapping (value = "/hello3") @ResponseBody public returnt<string> Hello3 (model model) {return new returnt <String> ("@ResponseBody pass Chinese garbled, solution A: Do not use the string string return value, use the" Custom Encapsulation Object "); } @RequestMapping (value = "/hello4") public String Hello4 (model model) {Model.addattribute ("resp", "@ResponseBody passing Chinese disorder  Code, Solution A: Do not use the "Chinese string string" return value, the use of "Freemarker receive the Reference" "); return "Comm.result"; }

Hession Integrated Spring + MAVEN dependent Communication Comm Project + solve @responsebody Chinese garbled

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.