1
+ <!DOCTYPE html>
2
+ < html >
3
+ < head >
4
+ < meta charset ="utf-8 ">
5
+
6
+ < title > StringHttpMessageConverter编码的问题 | Hexo</ title >
7
+ < meta name ="viewport " content ="width=device-width, initial-scale=1, maximum-scale=1 ">
8
+ < meta name ="description " content ="项目在运行某一个模块的时候,浏览器输出提示信息,如下图片所示 控制台打印的[DEBUG]信息如下: StringHttpMessageConverter默认使用的是ISO-8859-1的格式,修改方式如下: 12345678910111213141516171819&lt;bean class="org.springframework.web.servlet.mv ">
9
+ < meta property ="og:type " content ="article ">
10
+ < meta property ="og:title " content ="StringHttpMessageConverter编码的问题 ">
11
+ < meta property ="og:url " content ="http://yoursite.com/2017/09/13/StringHttpMessageConverter编码的问题/index.html ">
12
+ < meta property ="og:site_name " content ="Hexo ">
13
+ < meta property ="og:description " content ="项目在运行某一个模块的时候,浏览器输出提示信息,如下图片所示 控制台打印的[DEBUG]信息如下: StringHttpMessageConverter默认使用的是ISO-8859-1的格式,修改方式如下: 12345678910111213141516171819&lt;bean class="org.springframework.web.servlet.mv ">
14
+ < meta property ="og:image " content ="http://yoursite.com/2017/09/13/StringHttpMessageConverter编码的问题/encoding.png ">
15
+ < meta property ="og:image " content ="http://yoursite.com/2017/09/13/StringHttpMessageConverter编码的问题/![debug].png ">
16
+ < meta property ="og:updated_time " content ="2017-09-13T05:49:01.246Z ">
17
+ < meta name ="twitter:card " content ="summary ">
18
+ < meta name ="twitter:title " content ="StringHttpMessageConverter编码的问题 ">
19
+ < meta name ="twitter:description " content ="项目在运行某一个模块的时候,浏览器输出提示信息,如下图片所示 控制台打印的[DEBUG]信息如下: StringHttpMessageConverter默认使用的是ISO-8859-1的格式,修改方式如下: 12345678910111213141516171819&lt;bean class="org.springframework.web.servlet.mv ">
20
+ < meta name ="twitter:image " content ="http://yoursite.com/2017/09/13/StringHttpMessageConverter编码的问题/encoding.png ">
21
+
22
+ < link rel ="alternate " href ="/atom.xml " title ="Hexo " type ="application/atom+xml ">
23
+
24
+
25
+ < link rel ="icon " href ="/favicon.png ">
26
+
27
+
28
+ < link href ="//fonts.googleapis.com/css?family=Source+Code+Pro " rel ="stylesheet " type ="text/css ">
29
+
30
+ < link rel ="stylesheet " href ="/css/style.css ">
31
+
32
+
33
+ </ head >
34
+
35
+ < body >
36
+ < div id ="container ">
37
+ < div id ="wrap ">
38
+ < header id ="header ">
39
+ < div id ="banner "> </ div >
40
+ < div id ="header-outer " class ="outer ">
41
+ < div id ="header-title " class ="inner ">
42
+ < h1 id ="logo-wrap ">
43
+ < a href ="/ " id ="logo "> Hexo</ a >
44
+ </ h1 >
45
+
46
+ </ div >
47
+ < div id ="header-inner " class ="inner ">
48
+ < nav id ="main-nav ">
49
+ < a id ="main-nav-toggle " class ="nav-icon "> </ a >
50
+
51
+ < a class ="main-nav-link " href ="/ "> Home</ a >
52
+
53
+ < a class ="main-nav-link " href ="/archives "> Archives</ a >
54
+
55
+ </ nav >
56
+ < nav id ="sub-nav ">
57
+
58
+ < a id ="nav-rss-link " class ="nav-icon " href ="/atom.xml " title ="RSS Feed "> </ a >
59
+
60
+ < a id ="nav-search-btn " class ="nav-icon " title ="Search "> </ a >
61
+ </ nav >
62
+ < div id ="search-form-wrap ">
63
+ < form action ="//google.com/search " method ="get " accept-charset ="UTF-8 " class ="search-form "> < input type ="search " name ="q " class ="search-form-input " placeholder ="Search "> < button type ="submit " class ="search-form-submit "> </ button > < input type ="hidden " name ="sitesearch " value ="http://yoursite.com "> </ form >
64
+ </ div >
65
+ </ div >
66
+ </ div >
67
+ </ header >
68
+ < div class ="outer ">
69
+ < section id ="main "> < article id ="post-StringHttpMessageConverter编码的问题 " class ="article article-type-post " itemscope itemprop ="blogPost ">
70
+ < div class ="article-meta ">
71
+ < a href ="/2017/09/13/StringHttpMessageConverter编码的问题/ " class ="article-date ">
72
+ < time datetime ="2017-09-13T03:11:08.000Z " itemprop ="datePublished "> 2017-09-13</ time >
73
+ </ a >
74
+
75
+ </ div >
76
+ < div class ="article-inner ">
77
+
78
+
79
+ < header class ="article-header ">
80
+
81
+
82
+ < h1 class ="article-title " itemprop ="name ">
83
+ StringHttpMessageConverter编码的问题
84
+ </ h1 >
85
+
86
+
87
+ </ header >
88
+
89
+ < div class ="article-entry " itemprop ="articleBody ">
90
+
91
+ < p > 项目在运行某一个模块的时候,浏览器输出提示信息,如下图片所示< br > < br > < br > < img src ="encoding.png " alt ="encoding "> < br > < br > < br > < br > 控制台打印的[DEBUG]信息如下:< br > < br > < br > < img src ="![debug].png " alt ="debug] "> < br > < br > < br > < br > StringHttpMessageConverter默认使用的是ISO-8859-1的格式,修改方式如下:< br > < figure class ="highlight "> < table > < tr > < td class ="gutter "> < pre > < div class ="line "> 1</ div > < div class ="line "> 2</ div > < div class ="line "> 3</ div > < div class ="line "> 4</ div > < div class ="line "> 5</ div > < div class ="line "> 6</ div > < div class ="line "> 7</ div > < div class ="line "> 8</ div > < div class ="line "> 9</ div > < div class ="line "> 10</ div > < div class ="line "> 11</ div > < div class ="line "> 12</ div > < div class ="line "> 13</ div > < div class ="line "> 14</ div > < div class ="line "> 15</ div > < div class ="line "> 16</ div > < div class ="line "> 17</ div > < div class ="line "> 18</ div > < div class ="line "> 19</ div > </ pre > </ td > < td class ="code "> < pre > < div class ="line "> <bean < span class ="class "> < span class ="keyword "> class</ span > </ span > =< span class ="string "> "org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter"</ span > ></ div > < div class ="line "> <property name=< span class ="string "> "messageConverters"</ span > ></ div > < div class ="line "> <list></ div > < div class ="line "> <bean</ div > < div class ="line "> < span class ="class "> < span class ="keyword "> class</ span > </ span > =< span class ="string "> "org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"</ span > ></ div > < div class ="line "> <property name=< span class ="string "> "supportedMediaTypes"</ span > ></ div > < div class ="line "> <list></ div > < div class ="line "> <value>text/html;charset=UTF-8</value></ div > < div class ="line "> <value>text/plain;charset=UTF-8</value></ div > < div class ="line "> <value>application/json;charset=UTF-8</value></ div > < div class ="line "> </list></ div > < div class ="line "> </property></ div > < div class ="line "> </bean></ div > < div class ="line "> <bean < span class ="class "> < span class ="keyword "> class</ span > </ span > =< span class ="string "> "org.springframework.http.converter.StringHttpMessageConverter"</ span > ></ div > < div class ="line "> <property name=< span class ="string "> "supportedMediaTypes"</ span > value=< span class ="string "> "text/html;charset=UTF-8"</ span > /></ div > < div class ="line "> </bean></ div > < div class ="line "> </list></ div > < div class ="line "> </property></ div > < div class ="line "> </bean></ div > </ pre > </ td > </ tr > </ table > </ figure > </ p >
92
+ < p > 此外,上述代码要写在<mvc:annotation-driven>之前,因为它会在启动时自动注册RequestMappingHandlerAdapter。</ p >
93
+
94
+
95
+ </ div >
96
+ < footer class ="article-footer ">
97
+ < a data-url ="http://yoursite.com/2017/09/13/StringHttpMessageConverter编码的问题/ " data-id ="cj7ilwdt30000sovvcox868vv " class ="article-share-link "> Share</ a >
98
+
99
+
100
+ </ footer >
101
+ </ div >
102
+
103
+
104
+ < nav id ="article-nav ">
105
+
106
+
107
+ < a href ="/2017/09/12/关于项目控制台无法输出调试信息/ " id ="article-nav-older " class ="article-nav-link-wrap ">
108
+ < strong class ="article-nav-caption "> Older</ strong >
109
+ < div class ="article-nav-title "> 关于项目控制台无法输出调试信息</ div >
110
+ </ a >
111
+
112
+ </ nav >
113
+
114
+
115
+ </ article >
116
+
117
+ </ section >
118
+
119
+ < aside id ="sidebar ">
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+ < div class ="widget-wrap ">
131
+ < h3 class ="widget-title "> Archives</ h3 >
132
+ < div class ="widget ">
133
+ < ul class ="archive-list "> < li class ="archive-list-item "> < a class ="archive-list-link " href ="/archives/2017/09/ "> September 2017</ a > </ li > </ ul >
134
+ </ div >
135
+ </ div >
136
+
137
+
138
+
139
+
140
+ < div class ="widget-wrap ">
141
+ < h3 class ="widget-title "> Recent Posts</ h3 >
142
+ < div class ="widget ">
143
+ < ul >
144
+
145
+ < li >
146
+ < a href ="/2017/09/13/StringHttpMessageConverter编码的问题/ "> StringHttpMessageConverter编码的问题</ a >
147
+ </ li >
148
+
149
+ < li >
150
+ < a href ="/2017/09/12/关于项目控制台无法输出调试信息/ "> 关于项目控制台无法输出调试信息</ a >
151
+ </ li >
152
+
153
+ < li >
154
+ < a href ="/2017/09/09/hello-world/ "> Hello World</ a >
155
+ </ li >
156
+
157
+ </ ul >
158
+ </ div >
159
+ </ div >
160
+
161
+
162
+ </ aside >
163
+
164
+ </ div >
165
+ < footer id ="footer ">
166
+
167
+ < div class ="outer ">
168
+ < div id ="footer-info " class ="inner ">
169
+ © 2017 John Doe< br >
170
+ Powered by < a href ="http://hexo.io/ " target ="_blank "> Hexo</ a >
171
+ </ div >
172
+ </ div >
173
+ </ footer >
174
+ </ div >
175
+ < nav id ="mobile-nav ">
176
+
177
+ < a href ="/ " class ="mobile-nav-link "> Home</ a >
178
+
179
+ < a href ="/archives " class ="mobile-nav-link "> Archives</ a >
180
+
181
+ </ nav >
182
+
183
+
184
+ < script src ="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js "> </ script >
185
+
186
+
187
+ < link rel ="stylesheet " href ="/fancybox/jquery.fancybox.css ">
188
+ < script src ="/fancybox/jquery.fancybox.pack.js "> </ script >
189
+
190
+
191
+ < script src ="/js/script.js "> </ script >
192
+
193
+ </ div >
194
+ </ body >
195
+ </ html >
0 commit comments