From d84df3b00d3e0c790c5848a91c931fc0936dd7d6 Mon Sep 17 00:00:00 2001 From: Travis Bai Date: Wed, 20 Aug 2014 11:47:55 +0800 Subject: [PATCH] =?UTF-8?q?REST=E9=BB=98=E8=AE=A4=E8=BF=94=E5=9B=9EJSON?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 由于request中accept header中默认加入xml参数,导致contentNegotiationManager默认返回XML(即使设置defaultContentType=json) 还有加入ignoreAcceptHeader=true --- examples/showcase/src/main/webapp/WEB-INF/spring-mvc.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/showcase/src/main/webapp/WEB-INF/spring-mvc.xml b/examples/showcase/src/main/webapp/WEB-INF/spring-mvc.xml index 1174362b7..03fdd9e70 100644 --- a/examples/showcase/src/main/webapp/WEB-INF/spring-mvc.xml +++ b/examples/showcase/src/main/webapp/WEB-INF/spring-mvc.xml @@ -28,6 +28,8 @@ + + json=application/json