web环境下修改信息需要重启服务器,如果在一个大型的项目中经常重启服务器,那浪费的时间可想而知,今天介绍个好东西 —spring boot!一般学习都是从hello world开始学习的!下面介绍springboot 在maven配置和使用!
先进行pom.xml配置,
4.0.0
authentication
ammaven
war
0.0.1-SNAPSHOT
ammaven Maven Webapp
http://maven.apache.org
UTF-8
4.0.3.RELEASE
3.8.1
2.4
org.springframework.boot
spring-boot-starter-parent
1.0.1.RELEASE
org.springframework.boot
spring-boot-starter-web
commons-fileupload
commons-fileupload
1.3.1
commons-io
commons-io
${common-io}
junit
junit
${junitversion}
test
org.springframework
spring-aop
${springversion}
jar
compile
org.springframework
spring-aspects
${springversion}
jar
compile
org.springframework
spring-beans
${springversion}
jar
compile
org.springframework
spring-context
${springversion}
jar
compile
org.springframework
spring-context-support
${springversion}
jar
compile
org.springframework
spring-core
${springversion}
jar
compile
org.springframework
spring-expression
${springversion}
jar
compile
org.springframework
spring-jdbc
${springversion}
jar
compile
org.springframework
spring-jms
${springversion}
jar
compile
org.springframework
spring-orm
${springversion}
jar
compile
org.springframework
spring-oxm
${springversion}
jar
compile
org.springframework
spring-tx
${springversion}
jar
compile
org.springframework
spring-web
${springversion}
jar
compile
org.springframework
spring-webmvc
${springversion}
jar
compile
org.springframework
spring-test
${springversion}
jar
compile
javax.servlet
jstl
1.2
jar
compile
commons-collections
commons-collections
3.1
commons-logging
commons-logging
1.1
ammaven
下载完依赖的jar包下面开始配置spring和springMVC
首先配置和applicationContext.xml
<?xml version=”1.0” encoding=”UTF-8”?>
classpath:log4j.properties
再配置spring mvc:
<!— 配置异常处理
index
—>
最后需要配置web.xml
<?xml version=”1.0” encoding=”UTF-8”?>
MyMVC
index.jsp
contextConfigLocation
classpath:applicationContext.xml
log4jConfigLocation
classpath:log4j.properties
mvc
org.springframework.web.servlet.DispatcherServlet
contextConfigLocation
classpath:mvc.xml
true
1
mvc
*.mvc
org.springframework.web.util.Log4jConfigListener
org.springframework.web.context.ContextLoaderListener
还没有评论,来说两句吧...