mvc:cors
<mvc:mapping path="/**" allowed-origins="*" allowed-methods="GET, PUT, POST" max-age="3600" />
</mvc:cors>
在 Spring-servlet.xml 中添加以上配置,进行跨域AJAX调用后,控制台出现以下错误
2017-08-01 18:44:54.404 [http-bio-8088-exec-9] DEBUG [AbstractHandlerMethodMapping:304] - Looking up handler method for path /login
2017-08-01 18:44:54.405 [http-bio-8088-exec-9] DEBUG [AbstractHandlerMethodMapping:311] - Returning handler method [public java.lang.Object org.ibase4j.web.LoginController.login(org.ibase4j.model.Login,org.springframework.ui.ModelMap,javax.servlet.http.HttpServletRequest)]
2017-08-01 18:44:54.409 [http-bio-8088-exec-9] DEBUG [WebUtil:211] - Proxy-Client-IP ip: null
2017-08-01 18:44:54.409 [http-bio-8088-exec-9] DEBUG [WebUtil:215] - WL-Proxy-Client-IP ip: null
2017-08-01 18:44:54.410 [http-bio-8088-exec-9] DEBUG [WebUtil:219] - HTTP_CLIENT_IP ip: null
2017-08-01 18:44:54.410 [http-bio-8088-exec-9] DEBUG [WebUtil:223] - HTTP_X_FORWARDED_FOR ip: null
2017-08-01 18:44:54.410 [http-bio-8088-exec-9] DEBUG [WebUtil:227] - X-Real-IP ip: null
2017-08-01 18:44:54.410 [http-bio-8088-exec-9] DEBUG [WebUtil:231] - getRemoteAddr ip: 0:0:0:0:0:0:0:1
2017-08-01 18:44:54.411 [http-bio-8088-exec-9] ERROR [EventInterceptor:85] -
java.lang.ClassCastException: org.springframework.web.servlet.handler.AbstractHandlerMapping$PreFlightHandler cannot be cast to org.springframework.web.method.HandlerMethod