我一直得到这个HttpMediaTypeNotAcceptableException错误的AJAX请求时使用Spring MVC和JSON ..错误的完整堆栈跟踪是.. org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter$ServletHandlerMethodInvoker.writeWithMessageConverters(AnnotationMethodHandlerAdapter.java:1032) org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter$ServletHandlerMethodInvoker.handleResponseBody(AnnotationMethodHandlerAdapter.java:972) org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter$ServletHandlerMethodInvoker.getModelAndView(AnnotationMethodHandlerAdapter.java:921) org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:438) org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:424) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:863) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:792) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:851) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:756) javax.servlet.http.HttpServlet.service(HttpServlet.java:617) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) 我做了很less的search,显示请求应该包含像“接受:应用程序/ JSON”这是确实有..这里是从萤火虫的请求标题.. Response Headers Server Apache-Coyote/1.1 Content-Type text/html;charset=utf-8 Content-Length 2503 Date Thu, 25 Aug 2011 21:00:05 GMT Connection close Request Headers Host localhost:8080 User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.20) Gecko/20110803 Firefox/3.6.20 (.NET […]