Browse Source

修改附件上传问题Bug

suntg 8 years ago
parent
commit
c1b628f360
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/main/java/com/uas/platform/b2c/core/filter/KeyWordFilter.java

+ 3 - 1
src/main/java/com/uas/platform/b2c/core/filter/KeyWordFilter.java

@@ -36,7 +36,9 @@ public class KeyWordFilter implements Filter {
         HttpServletResponse response = (HttpServletResponse) arg1;
         response.setCharacterEncoding("UTF-8");
         response.setContentType("application/json; charset=utf-8");
-        if(!req.getMethod().equals("GET")){
+        String contentType = req.getContentType();
+        // 不是get请求,并且不是附件上传请求
+        if(!req.getMethod().equals("GET") && !contentType.contains("multipart")){
             //注入Service
             ServletContext sc = req.getSession().getServletContext();
             XmlWebApplicationContext cxt = (XmlWebApplicationContext) WebApplicationContextUtils.getWebApplicationContext(sc);