当前位置:网站首页>Chinese encoding Settings and action methods return values
Chinese encoding Settings and action methods return values
2022-07-31 17:19:00 【quack doctor】
Table of Contents
The return value of the action method
Chinese encoding settings

encode org.springframework.web.filter.CharacterEncodingFilter encoding UTF-8 forceRequestEncoding true forceResponseEncoding true encode /* Test Chinese encoding filter


Change all to post, and then submit!
The return value of the action method
The return value includes String, void, basic type, Model, ModelAndView, Map, custom class, custom output content, @ResponseBody decoration, etc.

1)String: The address of the client resource, the prefix and suffix are automatically spliced, and the automatic splicing string can also be shielded, and the returned path can be specified
2)Object: The object in json format is returned, and the object or collection is automaticallyConvert to json, using the Jackson tool for conversion, you must mention the jackson dependency, general user ajax request
3) void: no return value, generally used for ajax request
4) basic data type, useIn ajax request
5) ModelAndView: return data and view objects 
Complete the ajax request to access the server
(1) Add jackson dependency

Add Chinese code 

(2) Create a new js directory under the webapp directory and add the jQuery function library
(3) Import the function library on the index.jsp page
(4) Add the annotation @ResponseBody to the action to make the ajax request
(5) Add annotation-driven
com.fasterxml.jackson.core jackson-databind 2.9.8 
边栏推荐
- 牛客 HJ18 识别有效的IP地址和掩码并进行分类统计
- 阿里三面:MQ 消息丢失、重复、积压问题,如何解决?
- The article you worked so hard to write may not be your original
- How C programs run 01 - the composition of ordinary executable files
- JS基础小练习
- [TypeScript] OOP
- 6. 使用 Postman 工具高效管理和测试 SAP ABAP OData 服务
- 【luogu P8326】Fliper (Graph Theory) (Construction) (Eulerian Circuit)
- 几款永久免费内网穿透,好用且简单(内网穿透教程)
- 牛客 HJ17 坐标移动
猜你喜欢
随机推荐
每日练习------随机产生一个1-100之间的整数,看能几次猜中。要求:猜的次数不能超过7次,每次猜完之后都要提示“大了”或者“小了”。
牛客网刷题(一)
Flex布局详解
你辛辛苦苦写的文章可能不是你的原创
动态规划之线性dp(下)
【网络通信三】研华网关Modbus服务设置
京东获取商品历史价格信息 API
常用的安全渗透测试工具(渗透测试工具)
Golang go-redis cluster模式下不断创建新连接,效率下降问题解决
Combinatorics Notes (6) Associative Algebra of Locally Finite Partially Ordered Sets, Möbius Inversion Formula
MySQL---基本的select语句
ECCV 2022 华科&ETH提出首个用于伪装实例分割的一阶段Transformer的框架OSFormer!代码已开源!...
MySQL---子查询
[TypeScript]OOP
仿生毛毛虫机器人源码
How to install CV2 smoothly in Anaconda
AcWing 1282. 搜索关键词 题解((AC自动机)Trie+KMP)+bfs)
useragent在线查找
iNeuOS工业互联网操作系统,设备运维业务和“低代码”表单开发工具
Flutter set the background color of the statusbar status bar and APP method (AppBar) internal consistent color.









![[TypeScript]OOP](/img/d7/b3175ab538906ac1b658a9f361ba44.png)