前端发送了一个http PUT请求,如下,
json_xml: {"resourceId":"c6d8e78c873911e990c4baf58f5ddbd4","properties":{"process_id":"PPM_PLAN_APPROVE","name":"任务审批","documentation":"","process_author":"","process_namespace":"http://erdpsit.lk.cn/processdef","messages":[],"executionlisteners":{"executionListeners":[]},"eventlisteners":{"eventListeners":[]},"signaldefinitions":[],"messagedefinitions":[]},"stencil":{"id":"BPMNDiagram"},"childShapes":[{"resourceId":"sid-16566905-C655-45D0-BF64-E7218819837B","properties":{"overrideid":"sid-16566905-C655-45D0-BF64-E7218819837B","name":"","documentation":"","flowstate":null,"businessinterface":[{"interfaceType":"services","interfaceDescription":"","trigger":"start","interfacePath":"ppm_plan_elWorkFlowInstanceCallbackService.processInstanceStartNotify"}],"duedatedefinition":"${dueDate}","prioritydefinition":"${priority}"},"stencil":{"id":"StartNoneEvent"},"childShapes":[],"outgoing":[{"resourceId":"sid-D8F8D91C-6DF2-4D76-A2C8-CA7C2F38BEFA"}],"bounds":{"lowerRight":{"x":90,"y":115},"upperLeft":{"x":60,"y":85}},"dockers":[]},{"resourceId":"APPROVE","properties":{"overrideid":"APPROVE","name":"任务审批","documentation":"","el_multiinstance_type":"None","el_multiinstance_condition":"","el_multiinstance_collection":"","formproperties":{"formProperties":[{"id":"route_flag","name":"路由选择","type":"enum","expression":null,"variable":null,"enumValues":[{"name":"提交","id":"0"},{"name":"驳回","id":"1"}],"required":false,"readable":true,"writable":true}]},"rolekey":"APPROVE","flowstate":"APPROVE","serialnumber":"2","businessinterface":"","usertaskassignment":{"assignment":{"assignee":"${assignee}"}},"ismail":"false","prioritydefinition":"${priority}","duedatedefinition":"${dueDate}","asynchronousdefinition":false,"exclusivedefinition":true,"multiinstance_type":"Parallel","multiinstance_collection":"${parallelMulitiInstanceTask.multiInstanceUserCollectionByExecution(execution, 'APPROVE')}","multiinstance_variable":"assignee","multiinstance_condition":"${parallelMulitiInstanceTask.completeTaskCondition(execution,'route_flag', '1')}","tasklisteners":{"taskListeners":[]},"executionlisteners":{"executionListeners":[]}},"stencil":{"id":"UserTask"},"childShapes":[],"outgoing":[{"resourceId":"sid-E8FAD13E-E968-48B9-AE07-6C036F9A1BC9"}],"bounds":{"lowerRight":{"x":235,"y":140},"upperLeft":{"x":135,"y":60}},"dockers":[]},{"resourceId":"sid-D8F8D91C-6DF2-4D76-A2C8-CA7C2F38BEFA","properties":{"overrideid":"sid-D8F8D91C-6DF2-4D76-A2C8-CA7C2F38BEFA","name":"","documentation":"","conditionsequenceflow":"","executionlisteners":"","defaultflow":"false","duedatedefinition":"${dueDate}","prioritydefinition":"${priority}"},"stencil":{"id":"SequenceFlow"},"childShapes":[],"outgoing":[{"resourceId":"APPROVE"}],"bounds":{"lowerRight":{"x":134.15625,"y":100},"upperLeft":{"x":90.609375,"y":100}},"dockers":[{"x":15,"y":15},{"x":50,"y":40}],"target":{"resourceId":"APPROVE"}},{"resourceId":"sid-1E4B58D1-C372-4713-837A-DF849C03120B","properties":{"overrideid":"sid-1E4B58D1-C372-4713-837A-DF849C03120B","name":"","documentation":"","sequencefloworder":"","duedatedefinition":"${dueDate}","prioritydefinition":"${priority}"},"stencil":{"id":"ExclusiveGateway"},"childShapes":[],"outgoing":[{"resourceId":"sid-E5E4B786-6571-42B9-A3FE-EB9DF095AE6A"},{"resourceId":"sid-E65B8FF2-BD71-4B73-8550-D14A0982559A"}],"bounds":{"lowerRight":{"x":400.0000165303578,"y":120.0000018367064},"upperLeft":{"x":360.0000165303578,"y":80.0000018367064}},"dockers":[]},{"resourceId":"PREPARING","properties":{"overrideid":"PREPARING","name":"重新提交","documentation":"","el_multiinstance_type":"None","el_multiinstance_condition":"","el_multiinstance_collection":"","formproperties":{"formProperties":[{"id":"route_flag","name":"路由选择","type":"enum","expression":null,"variable":null,"enumValues":[{"name":"提交","id":"0"},{"name":"取消","id":"1"}],"required":false,"readable":true,"writable":true}]},"rolekey":"PM","flowstate":"PREPARING","serialnumber":"1","businessinterface":[{"interfaceType":"services","interfaceDescription":"用户任务节点开始执行","trigger":"start","interfacePath":"ppm_plan_elWorkFlowUserTaskCallbackService.userTaskStartNotify"},{"interfaceType":"services","interfaceDescription":"用户节点执行完成","trigger":"complate","interfacePath":"ppm_plan_elWorkFlowUserTaskCallbackService.userTaskComplateNotify"}],"usertaskassignment":{"assignment":{"assignee":"${startUserId}"}},"ismail":"false","prioritydefinition":"${priority}","duedatedefinition":"${dueDate}","asynchronousdefinition":false,"exclusivedefinition":true,"tasklisteners":{"taskListeners":[]},"executionlisteners":{"executionListeners":[]}},"stencil":{"id":"UserTask"},"childShapes":[],"outgoing":[{"resourceId":"sid-C736A0AC-672E-44B0-BC6F-80940D380668"}],"bounds":{"lowerRight":{"x":430,"y":320},"upperLeft":{"x":330,"y":240}},"dockers":[]},{"resourceId":"sid-3E54EDB3-A4CD-4E4C-BF4F-80A1AA3C211F","properties":{"overrideid":"sid-3E54EDB3-A4CD-4E4C-BF4F-80A1AA3C211F","name":"待执行","documentation":"","flowstate":"PENDING","businessinterface":[{"interfaceType":"services","interfaceDescription":"流程结束","trigger":"start","interfacePath":"ppm_plan_elWorkFlowEndEventCallbackService.endEventNotify"},{"interfaceType":"services","interfaceDescription":"任务审批完成后修改成员表责任人active=1","trigger":"start","interfacePath":"ppm_plan_elWorkFlowMemberService.updateHandlepersonState"}],"duedatedefinition":"${dueDate}","prioritydefinition":"${priority}"},"stencil":{"id":"EndNoneEvent"},"childShapes":[],"outgoing":[],"bounds":{"lowerRight":{"x":508,"y":114.0000018367064},"upperLeft":{"x":480,"y":86.0000018367064}},"dockers":[]},{"resourceId":"sid-EDB8541B-EAF3-4A57-A2A3-519758BB581E","properties":{"overrideid":"sid-EDB8541B-EAF3-4A57-A2A3-519758BB581E","name":"","documentation":"","sequencefloworder":"","duedatedefinition":"${dueDate}","prioritydefinition":"${priority}"},"stencil":{"id":"ExclusiveGateway"},"childShapes":[],"outgoing":[{"resourceId":"sid-10C41E64-73D2-46A6-92E5-D720DAC657FC"},{"resourceId":"sid-6057CE84-FFD6-4FCB-AC12-C6964D57C1FD"}],"bounds":{"lowerRight":{"x":205,"y":300},"upperLeft":{"x":165,"y":260}},"dockers":[]},{"resourceId":"sid-C736A0AC-672E-44B0-BC6F-80940D380668","properties":{"overrideid":"sid-C736A0AC-672E-44B0-BC6F-80940D380668","name":"","documentation":"","conditionsequenceflow":"","executionlisteners":"","defaultflow":"false","duedatedefinition":"${dueDate}","prioritydefinition":"${priority}"},"stencil":{"id":"SequenceFlow"},"childShapes":[],"outgoing":[{"resourceId":"sid-EDB8541B-EAF3-4A57-A2A3-519758BB581E"}],"bounds":{"lowerRight":{"x":329.48828125,"y":280},"upperLeft":{"x":205.04296875,"y":280}},"dockers":[{"x":50,"y":40},{"x":20,"y":20}],"target":{"resourceId":"sid-EDB8541B-EAF3-4A57-A2A3-519758BB581E"}},{"resourceId":"sid-5053B7AF-8D20-4F3D-AFB3-D9C325E3E1FE","properties":{"overrideid":"sid-5053B7AF-8D20-4F3D-AFB3-D9C325E3E1FE","name":"待发布","documentation":"","flowstate":"PREPARING","businessinterface":[{"interfaceType":"services","interfaceDescription":"取消,业务状态改为待发布","trigger":"start","interfacePath":"ppm_plan_elWorkFlowEndEventCallbackService.endEventNotify"}],"duedatedefinition":"${dueDate}","prioritydefinition":"${priority}"},"stencil":{"id":"EndNoneEvent"},"childShapes":[],"outgoing":[],"bounds":{"lowerRight":{"x":508,"y":388},"upperLeft":{"x":480,"y":360}},"dockers":[]},{"resourceId":"sid-E8FAD13E-E968-48B9-AE07-6C036F9A1BC9","properties":{"overrideid":"sid-E8FAD13E-E968-48B9-AE07-6C036F9A1BC9","name":"","documentation":"","conditionsequenceflow":"","executionlisteners":"","defaultflow":"false","duedatedefinition":"${dueDate}","prioritydefinition":"${priority}"},"stencil":{"id":"SequenceFlow"},"childShapes":[],"outgoing":[{"resourceId":"sid-1E4B58D1-C372-4713-837A-DF849C03120B"}],"bounds":{"lowerRight":{"x":359.9570461660651,"y":100.00000164792152},"upperLeft":{"x":235.51172294716116,"y":100.00000047577026}},"dockers":[{"x":50,"y":40},{"x":20,"y":20}],"target":{"resourceId":"sid-1E4B58D1-C372-4713-837A-DF849C03120B"}},{"resourceId":"sid-E5E4B786-6571-42B9-A3FE-EB9DF095AE6A","properties":{"overrideid":"sid-E5E4B786-6571-42B9-A3FE-EB9DF095AE6A","name":"审批完成","documentation":"","conditionsequenceflow":"${route_flag==0}","executionlisteners":"","defaultflow":"false","duedatedefinition":"${dueDate}","prioritydefinition":"${priority}"},"stencil":{"id":"SequenceFlow"},"childShapes":[],"outgoing":[{"resourceId":"sid-3E54EDB3-A4CD-4E4C-BF4F-80A1AA3C211F"}],"bounds":{"lowerRight":{"x":479.6406269371513,"y":100.0000018367064},"upperLeft":{"x":399.70313881834596,"y":100.0000018367064}},"dockers":[{"x":20,"y":20},{"x":14,"y":14}],"target":{"resourceId":"sid-3E54EDB3-A4CD-4E4C-BF4F-80A1AA3C211F"}},{"resourceId":"sid-E65B8FF2-BD71-4B73-8550-D14A0982559A","properties":{"overrideid":"sid-E65B8FF2-BD71-4B73-8550-D14A0982559A","name":"驳回","documentation":"","conditionsequenceflow":"${route_flag==1}","executionlisteners":"","defaultflow":"false","duedatedefinition":"${dueDate}","prioritydefinition":"${priority}"},"stencil":{"id":"SequenceFlow"},"childShapes":[],"outgoing":[{"resourceId":"PREPARING"}],"bounds":{"lowerRight":{"x":380.00001469508635,"y":239.62500040177952},"upperLeft":{"x":380.0000037078511,"y":119.98437664299126}},"dockers":[{"x":20,"y":20},{"x":50,"y":40}],"target":{"resourceId":"PREPARING"}},{"resourceId":"sid-10C41E64-73D2-46A6-92E5-D720DAC657FC","properties":{"overrideid":"sid-10C41E64-73D2-46A6-92E5-D720DAC657FC","name":"取消","documentation":"","conditionsequenceflow":"${route_flag==1}","executionlisteners":"","defaultflow":"false","duedatedefinition":"${dueDate}","prioritydefinition":"${priority}"},"stencil":{"id":"SequenceFlow"},"childShapes":[],"outgoing":[{"resourceId":"sid-5053B7AF-8D20-4F3D-AFB3-D9C325E3E1FE"}],"bounds":{"lowerRight":{"x":479.72265625,"y":374},"upperLeft":{"x":185,"y":300.09375}},"dockers":[{"x":20,"y":20},{"x":185,"y":374},{"x":14,"y":14}],"target":{"resourceId":"sid-5053B7AF-8D20-4F3D-AFB3-D9C325E3E1FE"}},{"resourceId":"sid-6057CE84-FFD6-4FCB-AC12-C6964D57C1FD","properties":{"overrideid":"sid-6057CE84-FFD6-4FCB-AC12-C6964D57C1FD","name":"重新提交审批","documentation":"","conditionsequenceflow":"${route_flag==0}","executionlisteners":"","defaultflow":"false","duedatedefinition":"${dueDate}","prioritydefinition":"${priority}"},"stencil":{"id":"SequenceFlow"},"childShapes":[],"outgoing":[{"resourceId":"APPROVE"}],"bounds":{"lowerRight":{"x":185,"y":260.015625},"upperLeft":{"x":185,"y":140.375}},"dockers":[{"x":20,"y":20},{"x":50,"y":40}],"target":{"resourceId":"APPROVE"}}],"bounds":{"lowerRight":{"x":3200,"y":5050},"upperLeft":{"x":0,"y":0}},"stencilset":{"url":"stencilsets/bpmn2.0/bpmn2.0.json","namespace":"http://b3mn.org/stencilset/bpmn2.0#"},"ssextensions":[]} svg_xml:
后端出现错误:
2019-06-05 18:43:38.268 ERROR 28652 --- [io-8094-exec-10] c.e.p.w.c.c.ELProcModelController : 缺少请求参数 org.springframework.web.bind.MissingServletRequestParameterException: Required String parameter 'name' is not present at org.springframework.web.method.annotation.RequestParamMethodArgumentResolver.handleMissingValue(RequestParamMethodArgumentResolver.java:202) ~[spring-web-5.1.5.RELEASE.jar!/:5.1.5.RELEASE] at org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.resolveArgument(AbstractNamedValueMethodArgumentResolver.java:113) ~[spring-web-5.1.5.RELEASE.jar!/:5.1.5.RELEASE] at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:126) ~[spring-web-5.1.5.RELEASE.jar!/:5.1.5.RELEASE] at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:166) ~[spring-web-5.1.5.RELEASE.jar!/:5.1.5.RELEASE] at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:134) ~[spring-web-5.1.5.RELEASE.jar!/:5.1.5.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102) ~[spring-webmvc-5.1.5.RELEASE.jar!/:5.1.5.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) ~[spring-webmvc-5.1.5.RELEASE.jar!/:5.1.5.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:800) ~[spring-webmvc-5.1.5.RELEASE.jar!/:5.1.5.RELEASE] at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.1.5.RELEASE.jar!/:5.1.5.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1038) ~[spring-webmvc-5.1.5.RELEASE.jar!/:5.1.5.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942) ~[spring-webmvc-5.1.5.RELEASE.jar!/:5.1.5.RELEASE] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005) [spring-webmvc-5.1.5.RELEASE.jar!/:5.1.5.RELEASE] at org.springframework.web.servlet.FrameworkServlet.doPut(FrameworkServlet.java:919) [spring-webmvc-5.1.5.RELEASE.jar!/:5.1.5.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:663) [tomcat-embed-core-9.0.16.jar!/:9.0.16] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882) [spring-webmvc-5.1.5.RELEASE.jar!/:5.1.5.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) [tomcat-embed-core-9.0.16.jar!/:9.0.16] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [tomcat-embed-core-9.0.16.jar!/:9.0.16] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.16.jar!/:9.0.16] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) [tomcat-embed-websocket-9.0.16.jar!/:9.0.16] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.16.jar!/:9.0.16] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.16.jar!/:9.0.16] at org.apache.catalina.filters.RemoteIpFilter.doFilter(RemoteIpFilter.java:845) [tomcat-embed-core-9.0.16.jar!/:9.0.16] at org.apache.catalina.filters.RemoteIpFilter.doFilter(RemoteIpFilter.java:902) [tomcat-embed-core-9.0.16.jar!/:9.0.16] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.16.jar!/:9.0.16] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.16.jar!/:9.0.16] at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123) [druid-1.1.5.jar!/:1.1.5] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.16.jar!/:9.0.16] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.16.jar!/:9.0.16] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) [spring-web-5.1.5.RELEASE.jar!/:5.1.5.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.5.RELEASE.jar!/:5.1.5.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.16.jar!/:9.0.16] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.16.jar!/:9.0.16] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:200) [tomcat-embed-core-9.0.16.jar!/:9.0.16] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-9.0.16.jar!/:9.0.16] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) [tomcat-embed-core-9.0.16.jar!/:9.0.16] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [tomcat-embed-core-9.0.16.jar!/:9.0.16] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat-embed-core-9.0.16.jar!/:9.0.16] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [tomcat-embed-core-9.0.16.jar!/:9.0.16] at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:679) [tomcat-embed-core-9.0.16.jar!/:9.0.16] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat-embed-core-9.0.16.jar!/:9.0.16] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) [tomcat-embed-core-9.0.16.jar!/:9.0.16] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-9.0.16.jar!/:9.0.16] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834) [tomcat-embed-core-9.0.16.jar!/:9.0.16] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415) [tomcat-embed-core-9.0.16.jar!/:9.0.16] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.16.jar!/:9.0.16] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_212] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_212] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.16.jar!/:9.0.16] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212]
关键信息是:缺少请求参数
全局搜索,找到了:
@ResponseBody @ResponseStatus(code = HttpStatus.BAD_REQUEST) @ExceptionHandler(BindException.class) public CommonResponse MethodArgumentNotValidHandler(BindException exception) throws Exception { logger.error("参数绑定验证失败:", exception); return CommonResponse.createCustomCommonResponse(String.valueOf(HttpStatus.BAD_REQUEST.value()), "缺少请求参数"); } /** * @param * @return * @description 缺少参数 * @author lk * @version v1.0 * @date 2017/9/6 */ @ResponseBody @ResponseStatus(code = HttpStatus.BAD_REQUEST) @ExceptionHandler(MissingServletRequestParameterException.class) public CommonResponse handleMissingServletRequestParameterException(MissingServletRequestParameterException e) { logger.error("缺少请求参数", e); return CommonResponse.createCustomCommonResponse(String.valueOf(HttpStatus.BAD_REQUEST.value()), "缺少请求参数"); }
嗯, 应该就是绑定问题,应该是ELProcModelController 的某个mvc方法的绑定问题。(实际上是 save 方法)但是,从错误日志来看,是找不到具体哪个方法的,因为根本都还没进去调用那个方法! 而是绑定参数的阶段就出了问题! 所以尝试去设置断点调试那个方法是没有用的!!
当然,调试handleMissingServletRequestParameterException 或MethodArgumentNotValidHandler 方法则是有用的。
奇怪的是,之前都是好好的, 怀疑是升级到spring boot-2.1.3 后就出现了这个问题。 网上的解决方案是 增加这么一个 FIlter,HttpPutFormContentFilter, 不过,这个类已经deprecated 了!why ,看这里:https://github.com/spring-projects/spring-boot/issues/13363
HttpPutFormContentFilter对delete方法不支持,FormContentFilter 更友好!
另外,需要注意到 前端收到400 ,并不是说前端的错误,其实还是 后端的错误。 虽然4xx是表示了前端请求的某些错误。其实不然。
参考
http://www.th7.cn/Program/java/201608/925805.shtml
https://www.oschina.net/question/2621611_2217526
https://blog.csdn.net/geloin/article/details/7444590