jackson简单实用及介绍

ssm整合的项目,Controller类往往返回两类数据,一类是string名。用于跳转,一类是返回数据给调用这个controller的前台。

使用jackson之后,可以根据response的注解。有response则返回为数据,没有response则返回为调用页面。

maven导包

 <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
	<dependency>
	    <groupId>com.fasterxml.jackson.core</groupId>
	    <artifactId>jackson-databind</artifactId>
	    <version>2.8.8</version>
	</dependency>

返回数据

jackson简单实用及介绍