I'm having problems getting Jackson to work in my Spring app.
I'm using
- Spring MVC 3.1.2
- Jackson 1.9.1 mapper asl
I've added the Jackson library to /WEB-INF/lib/ folder and added to my spring config file.
spring-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>
function in controller
<!-- 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;
}
When i go to localhost:8888/get_json i get a error 406.
I have tried a solutions on the internet but none of them seem to work. Any help would be appreciated!
PS: I use Spring MVC in combination with Google App Engine and Spring Security.