我有一个问题,要求推迟1分钟。
我在between框架上启用了跟踪日志,这表明FilterChainProxy
和DispatcherServlet
之间存在延迟。
到目前为止,我未能取得任何进展,因为这个问题是一致的。
应用程序日志
2022-08-31 16:12:31.256 TRACE 42851 --- [nio-9090-exec-7] o.s.s.w.a.i.FilterSecurityInterceptor : Authorizing filter invocation [POST /com/myrequest/my-action.do] with attributes [authenticated]
2022-08-31 16:12:31.256 DEBUG 42851 --- [nio-9090-exec-7] o.s.s.w.a.i.FilterSecurityInterceptor : Authorized filter invocation [POST /com/myrequest/my-action.do] with attributes [authenticated]
2022-08-31 16:12:31.256 TRACE 42851 --- [nio-9090-exec-7] o.s.s.w.a.i.FilterSecurityInterceptor : Did not switch RunAs authentication since RunAsManager returned null
2022-08-31 16:12:31.256 DEBUG 42851 --- [nio-9090-exec-7] o.s.security.web.FilterChainProxy : Secured POST /com/myrequest/my-action.do
2022-08-31 16:13:31.259 TRACE 42851 --- [nio-9090-exec-7] o.s.web.servlet.DispatcherServlet : POST "/com/myrequest/my-action.do", parameters={}, headers={masked} in DispatcherServlet 'dispatcherServlet'
2022-08-31 16:13:31.259 TRACE 42851 --- [nio-9090-exec-7] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean 'dashboardController'
弹簧引导application.yml
文件
logging:
level:
org.springframework: TRACE
com.myorg: TRACE
这是基于maven的项目,我正在使用spring-boot-starter-parent:2.5.12
。
发布于 2022-09-01 12:38:14
最后,在同事的帮助下,我们发现内容类型是不正确的。
在调用来自jQuery Ajax的请求时,我们不会在POST请求上传递任何内容类型,后者默认为application/x-www-form-urlencoded; charset=UTF-8
,而在控制器端,我们没有任何consumes
。在双方通过正确的contentType之后,我们能够解决这个问题。
https://stackoverflow.com/questions/73561767
复制