此文仅用于个人用途。
package com.nigthmare.springboot;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
*
* @author 闪光
* @version $Id: NigthmareSpringbootController.java, v 0.1 2020年9月29日 上午10:25:45 shanguang Exp $
*/
@RestController
public class NigthmareSpringbootController {
@RequestMapping("/helloworld")
public String helloWorld(String name) {
System.out.println(name);
return name + "hello world!";
}
/**
* 1. 创建maven项目,pom文件配置(配置spingboot相关jar)
*
* 2. 数据库连接配置(application.properties)
*
* 3. 创建启动类Application
*
* 4. 创建页面请求类Controller,发布接口Interface
*
* 5. 启动类Application run 方法启动Springboot 服务
*
* 6. 输入链接请求测试接口Interface
*
* groupId:
* org.springframework.boot
*
* artifactId:
* spring-boot-starter-parent:Spring Boot的父级依赖,标识当前项目为Spring Boot项目。
* spring-boot-starter-parent 是一个特殊的starter,它用来提供相关的Maven默认依赖。使用它之后,常用的包依赖可以省去version标签。
*
*
* Maven的用户可以通过继承spring-boot-starter-parent项目来获得一些合理的默认配置。这个parent提供了以下特性:
* 默认使用Java 8
* 使用UTF-8编码
* 一个引用管理的功能,在dependencies里的部分配置可以不用填写version信息,这些version信息会从spring-boot-dependencies里得到继承。
* 识别过来资源过滤(Sensible resource filtering.)
* 识别插件的配置(Sensible plugin configuration (exec plugin, surefire, Git commit ID, shade).)
* 能够识别application.properties和application.yml类型的文件,同时也能支持profile-specific类型的文件(如: application-foo.properties and application-foo.yml,这个功能可以更好的配置不同生产环境下的配置文件)。
* maven把默认的占位符${…}改为了@..@(这点看下原文自己理解下)
* since the default config files accept Spring style placeholders (${…}) the Maven filtering is changed to use @..@ placeholders (you can override that with a Maven property resource.delimiter).)
*
* 如果dependencies中的一些引用不想使用默认的版本,可以直接加上version信息,把默认的覆盖掉。
*
* spring-boot-starter: 核心Spring Boot starter ,包括自动配置支持,日志和YAML
* spring-boot-starter-actuator 生产准备的特性,用于帮你监控和管理应用
* spring-boot-starter-amqp 对高级消息队列协议的支持,通过spring-rabbit实现
* spring-boot-starter-aop 对面向切面变成的支持,通过spring-aop和AspectJ
* spring-boot-starter-batch 对Spring batch 的支持,包括HSQLDB数据库
* spring-boot-starter-cloud-connection 对Spring Cloud Connection的支持,简化在云平台下(例如,Cloud Foundry和Heroku)服务的连接
* spring-boot-starter-elasticsearch 对Elasticsearche搜索和分析引擎的支持,包括spring-data-elasticsearch
* spring-boot-starter-data-gemfire 对GemFire分布式数据存储的支持,包括spring-data-gemfire
* spring-boot-starter-data-jpa 对java持久化API的支持,包括Spring-data-jpa,spring-orm和Hibernate
* spring-boot-starter-data-mongodb 对MongoDB NOSQL数据库的支持,包括spring-data-mongodb
* spring-boot-starter-data-rest 通过对REST暴露Spring data仓库的支持,通过spring-data-rest-webmvc实现
* spring-boot-starter-data-solr 对Apache Solr搜索平台的支持,包括spring-data-solr
* spring-boot-starter-freemaker 对FreeMarker模板引擎的支持
* spring-boot-starter-Groovy 对Groovy模板引擎的支持
* spring-boot-starter-hateoas 对基于HATEOAS的RESTful服务的支持,通过spring-hateoas
* spring-boot-starter-integration 对普通spring-integration模块的支持
* spring-boot-starter-hornetq 对”java消息服务API”的支持,通过HornetQ实现
* spring-boot-starter-jdbc 对JDBC数据库的支持
* spring-boot-starter-jersey 对Jersey RESTful Web服务框架的支持
* spring-boot-starter-jta-atomikos 对JTA分布式事务的支持。通过Atomikos实现
* spring-boot-starter-jta-bitronix 对JTA分布式事务的支持,通过Bitronix实现
* spring-boot-starter-mail 对javax.mail的支持
* spring-boot-starter-mobile 对spring-mobile的支持
* spring-boot-starter-redis 对REDIS键值数据存储的支持,包括Spring-redis
* spring-boot-starter-security 对spring -security模板引擎的支持
* spring-boot-starter-social-facebook 对spring-social-facebook的支持
* spring-boot-starter-social-twitter 对spring-social-twitter的支持
* spring-boot-starter-test 对常用测试依赖的支持,包括JUnit,Hamcrest和Mockito还有spring-test模块
* spring-boot-starter-thymeleaf 对Thymeleaf模板引擎的支持,包括和Spring的集成
* spring-boot-starter-velocity 对velocity模板引擎的支持
* spring-boot-starter-web 对全栈web开发的支持,包括Tomcat和spring-webmvc
* spring-boot-starter-websocket 对websocket开发的支持
* spring-boot-starter-ws 对Spring web服务的支持
*
* Spring Boot包含一些可用于排除或交换具体技术方面的starters
*
* artifactId:
* spring-boot-starter-jetty 导入Jetty HTTP引擎(作为Tomcat的代替)
* spring-boot-starter-log4j 对Log4J日志系统的支持
* spring-boot-starter-logging 导入SpringBoot的默认日志系统(Logback)
* spring-boot-starter-tomcat 导入SpringBoot的默认HTTP引擎(Tomcat)
* spring-boot-starter-undertow 导入Undertow HTTP引擎(作为tomcat的代替)
*
* @author 闪光
*/
public void SpringBootDescription() {
}
}