博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
spring,springmvc搭建一个只返回数据的项目
阅读量:4228 次
发布时间:2019-05-26

本文共 3050 字,大约阅读时间需要 10 分钟。

本文主要讲述一下利用spring、springmvc搭建一个返回json数据的项目,主要是一些配置文件。

pom.xml中需要的依赖

UTF-8
1.7
1.7
4.3.18.RELEASE
2.9.6
junit
junit
4.11
test
javax.servlet
javax.servlet-api
3.1.0
provided
org.springframework
spring-context
${spring.version}
org.springframework
spring-web
${spring.version}
org.springframework
spring-webmvc
${spring.version}
org.springframework
spring-aop
${spring.version}
org.springframework
spring-aspects
${spring.version}
com.fasterxml.jackson.core
jackson-core
${jackson.version}
com.fasterxml.jackson.core
jackson-databind
${jackson.version}
com.fasterxml.jackson.core
jackson-annotations
${jackson.version}

spring配置文件

取文件名为applicationContext.xml

spring mvc配置文件

取文件名为springmvc-servlet.xml

web.xml

Archetype Created Web Application
contextConfigLocation
classpath:applicationContext.xml
org.springframework.web.context.ContextLoaderListener
dispatcherServlet
org.springframework.web.servlet.DispatcherServlet
contextConfigLocation
classpath:springmvc-servlet.xml
1
dispatcherServlet
/

总结

至此,项目配置就完成了,在com.zhan.design.controller中添加一个restController测试即可。

转载地址:http://jhjqi.baihongyu.com/

你可能感兴趣的文章
Creating a Digital Home Entertainment System with Windows Media Center
查看>>
Java Concurrency in Practice
查看>>
Red Hat Fedora 5 Unleashed
查看>>
AdvancED Flash Interface Design (Advanced Design)
查看>>
Quartz Job Scheduling Framework: Building Open Source Enterprise Applications
查看>>
C++ GUI Programming with Qt 4
查看>>
Effective Use of Microsoft Enterprise Library: Building Blocks for Creating Enterprise Applications
查看>>
Java For Artists: The Art, Philosophy, And Science Of Object-Oriented Programming
查看>>
Moodle E-learning Course Development
查看>>
VoIP For Dummies
查看>>
Administrator's Guide to SQL Server 2005
查看>>
Ajax Design Patterns
查看>>
DNS and BIND (5th Edition)
查看>>
Firewall Fundamentals
查看>>
Learning PHP and MySQL
查看>>
Agile Software Construction
查看>>
Computer Security Basics
查看>>
Sams Teach Yourself MySQL in 10 Minutes
查看>>
Information Systems : The State of the Field
查看>>
IPv6 Essentials
查看>>