当前位置:网站首页>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
边栏推荐
猜你喜欢
【pytorch】pytorch 自动求导、 Tensor 与 Autograd
Automated testing - web automation - first acquaintance with selenium
自动化测试—web自动化—selenium初识
Kotlin coroutines: continuation, continuation interceptor, scheduler
How C programs run 01 - the composition of ordinary executable files
研发过程中的文档管理与工具
GateWay实现负载均衡
MySQL---运算符
二分查找的细节坑
TestCafe总结
随机推荐
IP protocol from 0 to 1
Go basic part study notes
MySQL---aggregate function
智能垃圾桶(九)——震动传感器(树莓派pico实现)
每日练习------随机产生一个1-100之间的整数,看能几次猜中。要求:猜的次数不能超过7次,每次猜完之后都要提示“大了”或者“小了”。
[pytorch] pytorch automatic derivation, Tensor and Autograd
京东获取商品历史价格信息 API
迁移学习——Domain Adaptation
这位985教授火了!当了10年博导,竟无一博士毕业!
组合学笔记(六)局部有限偏序集的关联代数,Möbius反演公式
TestCafe之如何进行调试
go mode tidy出现报错go warning “all“ matched no packages
Handling Write Conflicts under Multi-Master Replication (1)-Synchronous and Asynchronous Conflict Detection and Conflict Avoidance
How to install CV2 smoothly in Anaconda
A common method and the use of selenium
Golang 必知必会Go Mod命令
Verilog实现占空比为5/18的9分频
Last write wins (discards concurrent writes)
学生管理系统第一天:完成登录退出操作逻辑 PyQt5 + MySQL5.8
研发过程中的文档管理与工具