Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Jeepay
Commits
223a1f2b
Commit
223a1f2b
authored
Nov 19, 2021
by
terrfly
Browse files
MediaType.APPLICATION_JSON_UTF8_VALUE
parent
a3423c4b
Changes
1
Hide whitespace changes
Inline
Side-by-side
jeepay-core/src/main/java/com/jeequan/jeepay/core/exception/BizExceptionResolver.java
View file @
223a1f2b
...
@@ -21,6 +21,7 @@ import org.apache.logging.log4j.LogManager;
...
@@ -21,6 +21,7 @@ import org.apache.logging.log4j.LogManager;
import
org.apache.logging.log4j.Logger
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.dao.DataAccessException
;
import
org.springframework.dao.DataAccessException
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.servlet.HandlerExceptionResolver
;
import
org.springframework.web.servlet.HandlerExceptionResolver
;
import
org.springframework.web.servlet.ModelAndView
;
import
org.springframework.web.servlet.ModelAndView
;
...
@@ -80,7 +81,8 @@ public class BizExceptionResolver implements HandlerExceptionResolver {
...
@@ -80,7 +81,8 @@ public class BizExceptionResolver implements HandlerExceptionResolver {
public
void
outPutJson
(
HttpServletResponse
res
,
String
jsonStr
)
throws
IOException
{
public
void
outPutJson
(
HttpServletResponse
res
,
String
jsonStr
)
throws
IOException
{
res
.
setContentType
(
"text/json;charset=utf-8"
);
res
.
setContentType
(
MediaType
.
APPLICATION_JSON_UTF8_VALUE
);
res
.
getWriter
().
write
(
jsonStr
);
res
.
getWriter
().
write
(
jsonStr
);
res
.
getWriter
().
flush
();
res
.
getWriter
().
flush
();
res
.
getWriter
().
close
();
res
.
getWriter
().
close
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment