当前位置:网站首页>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
边栏推荐
- JS基础小练习
- 每日练习------随机产生一个1-100之间的整数,看能几次猜中。要求:猜的次数不能超过7次,每次猜完之后都要提示“大了”或者“小了”。
- 如何识别假爬虫?
- Huawei's top engineers lasted nine years "anecdotal stories network protocol" PDF document summary, is too strong
- 牛客 HJ18 识别有效的IP地址和掩码并进行分类统计
- Three aspects of Ali: How to solve the problem of MQ message loss, duplication and backlog?
- Kotlin coroutines: continuation, continuation interceptor, scheduler
- MySQL---Subqueries
- Verilog实现占空比为5/18的9分频
- useragent在线查找
猜你喜欢
Kotlin coroutines: continuation, continuation interceptor, scheduler
杰理语音芯片ic玩具芯片ic的介绍_AD14NAD15N全系列开发
最新神作!阿里巴巴刚出炉的面试参考指南(泰山版),我直接狂刷29天
使用互相关进行音频对齐
TestCafe总结
[pytorch] 1.7 pytorch and numpy, tensor and array conversion
MySQL---多表查询
IP protocol from 0 to 1
2022年Android 面经总结(附含面试题 | 源码 | 面试资料)
2022 Android interview summary (with interview questions | source code | interview materials)
随机推荐
Small program: Matlab solves differential equations "recommended collection"
每日练习------随机产生一个1-100之间的整数,看能几次猜中。要求:猜的次数不能超过7次,每次猜完之后都要提示“大了”或者“小了”。
Anaconda如何顺利安装CV2
动态规划之线性dp(下)
智能垃圾桶(九)——震动传感器(树莓派pico实现)
[pytorch] pytorch automatic derivation, Tensor and Autograd
Huawei's top engineers lasted nine years "anecdotal stories network protocol" PDF document summary, is too strong
35道MySQL面试必问题图解,这样也太好理解了吧
【luogu P8326】Fliper (Graph Theory) (Construction) (Eulerian Circuit)
你辛辛苦苦写的文章可能不是你的原创
iNeuOS工业互联网操作系统,设备运维业务和“低代码”表单开发工具
MATLAB程序设计与应用 2.4 MATLAB常用内部函数
Kotlin coroutines: continuation, continuation interceptor, scheduler
【网络通信三】研华网关Modbus服务设置
Intelligent bin (9) - vibration sensor (raspberries pie pico implementation)
Multi-datacenter operation and detection of concurrent writes
GP 6 overall architecture study notes
关于柱状图的经典画法总结
LevelSequence源码分析
【Yugong Series】July 2022 Go Teaching Course 022-Dictionary of Go Containers