0
Jackson이 Spring 애플리케이션에서 작동하도록하는 데 문제가 있습니다.Spring in Spring MVC 3.1.2
내가 사용
- 스프링 MVC는 3.1.2
- 잭슨의 I/WEB-INF/lib 디렉토리/폴더에 잭슨 라이브러리를 추가 한
ASL 매퍼를 한 묶음 내 봄 설정 파일에 추가되었습니다. 컨트롤러
는봄-config.xml에
<!-- language: xml-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd">
<mvc:annotation-driven />
<context:component-scan base-package="com.mason.server.controller" />
<bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix">
<value>/WEB-CONTENT/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>
<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basename" value="WEB-INF/messages/messages" />
</bean>
기능
<!-- language: java -->
@RequestMapping(value = "/get_json", method = RequestMethod.GET, headers = "Accept=*/*")
public @ResponseBody List<String> getTechList() {
List<String> countryList = new ArrayList<String>();
countryList.add("test");
return countryList;
}
내가 localhost로 이동 : 8888/get_json 내가 오류를 406
I를 얻을 수 인터넷에서 솔루션을 시도했지만 그 중 아무 것도 작동하지 않는 것 같습니다. 어떤 도움을 주시면 감사하겠습니다!
추신 : 저는 Google App Engine 및 스프링 보안과 함께 Spring MVC를 사용합니다.
, 내가 곧 내 솔루션을 게시 할 예정입니다 – areont