SpringBoot 初体验(一)

刚试了下springBoot 觉得挺好用的

package com.julongtech.action;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@EnableAutoConfiguration
public class HelloAction {
	@RequestMapping("/")
	@ResponseBody
	String home() {
		return "Hello World!";
	}
	/**
	 * @param args
	 * @author julong
	 * @date 2017-2-14 下午10:33:25
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		SpringApplication.run(HelloAction.class, args);
	}

	

}

引用得jar
 <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.3.8.RELEASE</version>
    </parent>
  <dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
	<groupId>org.springframework</groupId>
	<artifactId>spring-core</artifactId>
	<exclusions>
		<exclusion>
			<groupId>commons-logging</groupId>
			<artifactId>commons-logging</artifactId>
		</exclusion>
	</exclusions>
</dependency>

上边是maven得配置方式
D:\repo\org\springframework\boot\spring-boot-starter-web\1.3.8.RELEASE\spring-boot-starter-web-1.3.8.RELEASE.jar
D:\repo\org\springframework\boot\spring-boot-starter\1.3.8.RELEASE\spring-boot-starter-1.3.8.RELEASE.jar
D:\repo\org\springframework\boot\spring-boot\1.3.8.RELEASE\spring-boot-1.3.8.RELEASE.jar
D:\repo\org\springframework\spring-core\4.2.8.RELEASE\spring-core-4.2.8.RELEASE.jar
D:\repo\org\springframework\spring-context\4.2.8.RELEASE\spring-context-4.2.8.RELEASE.jar
D:\repo\org\springframework\spring-aop\4.2.8.RELEASE\spring-aop-4.2.8.RELEASE.jar
D:\repo\aopalliance\aopalliance\1.0\aopalliance-1.0.jar
D:\repo\org\springframework\spring-beans\4.2.8.RELEASE\spring-beans-4.2.8.RELEASE.jar
D:\repo\org\springframework\spring-expression\4.2.8.RELEASE\spring-expression-4.2.8.RELEASE.jar
D:\repo\org\springframework\boot\spring-boot-autoconfigure\1.3.8.RELEASE\spring-boot-autoconfigure-1.3.8.RELEASE.jar
D:\repo\org\springframework\boot\spring-boot-starter-logging\1.3.8.RELEASE\spring-boot-starter-logging-1.3.8.RELEASE.jar
D:\repo\ch\qos\logback\logback-classic\1.1.7\logback-classic-1.1.7.jar
D:\repo\ch\qos\logback\logback-core\1.1.7\logback-core-1.1.7.jar
D:\repo\org\slf4j\slf4j-api\1.7.21\slf4j-api-1.7.21.jar
D:\repo\org\slf4j\jcl-over-slf4j\1.7.21\jcl-over-slf4j-1.7.21.jar
D:\repo\org\slf4j\jul-to-slf4j\1.7.21\jul-to-slf4j-1.7.21.jar
D:\repo\org\slf4j\log4j-over-slf4j\1.7.21\log4j-over-slf4j-1.7.21.jar
D:\repo\org\yaml\snakeyaml\1.16\snakeyaml-1.16.jar
D:\repo\org\springframework\boot\spring-boot-starter-tomcat\1.3.8.RELEASE\spring-boot-starter-tomcat-1.3.8.RELEASE.jar
D:\repo\org\apache\tomcat\embed\tomcat-embed-core\8.0.37\tomcat-embed-core-8.0.37.jar
D:\repo\org\apache\tomcat\embed\tomcat-embed-el\8.0.37\tomcat-embed-el-8.0.37.jar
D:\repo\org\apache\tomcat\embed\tomcat-embed-logging-juli\8.0.37\tomcat-embed-logging-juli-8.0.37.jar
D:\repo\org\apache\tomcat\embed\tomcat-embed-websocket\8.0.37\tomcat-embed-websocket-8.0.37.jar
D:\repo\org\springframework\boot\spring-boot-starter-validation\1.3.8.RELEASE\spring-boot-starter-validation-1.3.8.RELEASE.jar
D:\repo\org\hibernate\hibernate-validator\5.2.4.Final\hibernate-validator-5.2.4.Final.jar
D:\repo\javax\validation\validation-api\1.1.0.Final\validation-api-1.1.0.Final.jar
D:\repo\org\jboss\logging\jboss-logging\3.3.0.Final\jboss-logging-3.3.0.Final.jar
D:\repo\com\fasterxml\classmate\1.1.0\classmate-1.1.0.jar
D:\repo\com\fasterxml\jackson\core\jackson-databind\2.6.7\jackson-databind-2.6.7.jar
D:\repo\com\fasterxml\jackson\core\jackson-annotations\2.6.7\jackson-annotations-2.6.7.jar
D:\repo\com\fasterxml\jackson\core\jackson-core\2.6.7\jackson-core-2.6.7.jar
D:\repo\org\springframework\spring-web\4.2.8.RELEASE\spring-web-4.2.8.RELEASE.jar
D:\repo\org\springframework\spring-webmvc\4.2.8.RELEASE\spring-webmvc-4.2.8.RELEASE.jar


这个是一个完整的项目的依赖
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值