Commit 223a1f2b authored by terrfly's avatar terrfly
Browse files

MediaType.APPLICATION_JSON_UTF8_VALUE

parent a3423c4b
...@@ -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();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment