Jackson 2.0 with Spring 3.1

前端 未结 6 1290
面向向阳花
面向向阳花 2020-11-28 09:22

Is Spring MVC 3.1 compatible with Jackson 2.0? Will Spring MVC\'s automatic detection of Jackson on the classpath, and delegation to Jackson for requests with a JSON content

6条回答
  •  野性不改
    2020-11-28 09:53

    Since Spring 3.1.2 you simply have to add jackson-databind jar to your classpath.

    In Maven you can configure it like this:

    
        com.fasterxml.jackson.core
        jackson-databind
        ${jackson.version}
    
    
        com.fasterxml.jackson.core
        jackson-core
        ${jackson.version}
    
    

    The rest of the magic will be done by spring automatically.

    See: http://norrisshelton.wordpress.com/2012/07/15/spring-3-mvc-with-json-via-jackson-2-0/

提交回复
热议问题