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