본문 바로가기

Others/Error

[스프링] 스프링 Spring AJAX 406 Not Acceptable 에러시 해결법


<!-- https://mvnrepository.com/artifact/org.codehaus.jackson/jackson-mapper-asl -->

<dependency>

<groupId>org.codehaus.jackson</groupId>

<artifactId>jackson-mapper-asl</artifactId>

<version>1.5.0</version>

</dependency>



produces = "application/json"를 안붙혀서 라는데 실제로는 위의 코드가 pom.xml에 위의 코드가 없을 가능성이 크다.


저걸로도 에러가 뜬다면 produces = "application/json"을 mapper쪽에 붙히면 될것이다. 


@ResponseBody

@RequestMapping(value = "/ajax", method = RequestMethod.POST,  produces = "application/json")

public ArrayList<String> ajax() {





출처: http://stratosphere.tistory.com/54 [StratoSphere Stream]