PageHelper 中文乱码

PageHelper 中文乱码

 

在springmvc 的 mvc:annotation-driven 中配置编码

<mvc:annotation-driven /> 会自动注册DefaultAnnotationHandlerMapping与AnnotationMethodHandlerAdapter 两个bean,是spring MVC为@Controllers分发请求所必须的,即解决了@Controller注解使用的前提配置。

 <mvc:annotation-driven /> is actually rather pointless. It declares explicit support for annotation-driven MVC controllers (i.e.@RequestMapping@Controller, etc), even though support for those is the default behaviour.

 

response.setCharacterEncoding("text/html;charset=UTF-8"); 加在json对象前

 

 

 

REF

https://ask.csdn.net/questions/337009

 

posted @ 2021-12-25 22:52  emanlee  阅读(161)  评论(0编辑  收藏  举报