1、引入下面两个jar包,我用的是1.8.10,好像1.4.2版本以上都可以,下载地址:http://wiki.fasterxml.com/JacksonDownload
jackson-core-asl-1.8.10.jar
jackson-mapper-asl-1.8.10.jar
同时引入Sping 本身的jar包:
org.springframework.asm-3.1.1.RELEASE.jar
org.springframework.beans-3.1.1.RELEASE.jar
org.springframework.context-3.1.1.RELEASE.jar
org.springframework.core-3.1.1.RELEASE.jar
org.springframework.expression-3.1.1.RELEASE.jar
org.springframework.web-3.1.1.RELEASE.jar
2、Sping配置文件
web.xml
servlet-config.xml:
接着,我们再定义一个java类:
然后我们在页面调用url即可。