SpringBoot 搭建
1、使用Eclipse 建立Maven项目(webapp OR quickstart)
2、配置Maven,如下:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.5.RELEASE</version>
<relativePath/>
</parent> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
</properties> <dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies> <build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
3、建立启动Application
package demo.web.application;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan; @SpringBootApplication
@ComponentScan(basePackages={"demo.web.*"})
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
} }
4、编辑Controller
package demo.web.controller;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; @RestController
@EnableAutoConfiguration
public class HelloController { @RequestMapping("/")
String home() {
System.out.println("ee");
return "Hello World!";
} @RequestMapping("/hello/{myName}")
String index(@PathVariable String myName) {
return "Hello "+myName+"!!!";
} }
5、通过application.properties对项目进行配置
server.port=9000
项目文件布局如下:

启动Application程序,即可访问网站。

SpringBoot 搭建的更多相关文章
- Springboot搭建SSM+JSP的web项目
Springboot搭建SSM+JSP的web项目 一:创建项目结构: 项目结构分为三个部分: 1 后端项目开发文件: 包: Util 工具包 Mapper db层 Serv ...
- 基于SpringBoot搭建应用开发框架(二) —— 登录认证
零.前言 本文基于<基于SpringBoot搭建应用开发框架(一)——基础架构>,通过该文,熟悉了SpringBoot的用法,完成了应用框架底层的搭建. 在开始本文之前,底层这块已经有了很 ...
- springBoot 搭建web项目(前后端分离,附项目源代码地址)
springBoot 搭建web项目(前后端分离,附项目源代码地址) 概述 该项目包含springBoot-example-ui 和 springBoot-example,分别为前端与后端,前后端 ...
- SpringBoot 试手(简易的SpringBoot搭建步骤)
SpringBoot 也算AI吧,它根据您架构中引用的依赖,自动化地按默认方案帮您完成了Spring那些复杂繁琐的配置工作.为了让您不会看低此 AI 水平,还特地喊出了“约定大于配置”的口号.从这个角 ...
- SpringBoot 搭建简单聊天室
SpringBoot 搭建简单聊天室(queue 点对点) 1.引用 SpringBoot 搭建 WebSocket 链接 https://www.cnblogs.com/yi1036943655/p ...
- springboot搭建一个简单的websocket的实时推送应用
说一下实用springboot搭建一个简单的websocket 的实时推送应用 websocket是什么 WebSocket是一种在单个TCP连接上进行全双工通信的协议 我们以前用的http协议只能单 ...
- Springboot搭建Eureka并设置Eureka登录账号密码
Springboot搭建Eureka并设置Eureka登录账号密码 一.创建一个springboot项目 1.可以使用Spring Initializr,用浏览器打开http://start.spri ...
- 使用SpringBoot搭建Web项目
序言 从简入深的使用SpringBoot搭建一个Web项目,同时也包括一些小的问题.第一篇博文是以较为简单的方式完成一个可以连接数据库的Springboot web程序.之前自己学习的时候看网上的教程 ...
- SpringBoot 搭建基于 MinIO 的高性能存储服务
1.什么是MinIO MinIO是根据GNU Affero通用公共许可证v3.0发布的高性能对象存储.它与Amazon S3云存储服务兼容.使用MinIO构建用于机器学习,分析和应用程序数据工作负载的 ...
- 用SpringBoot搭建简单电商项目 01
前几节呢,我们已经简单介绍了SpringBoot框架的使用,从这一节开始,我们尝试着使用SpringBoot框架来一步一步搭建一个简单电商项目.当然了,这不是真正的电商项目,你可以看成是一个CRUD案 ...
随机推荐
- noip模拟赛 算
[问题背景]zhx 帮他妹子做数学题.[问题描述]求: 如 N=3, M=3, 这个值为 1^1+1^2+1^3+2^1+2^2+2^3+3^1+3^2+3^3=56. [输入格式]仅一行, 包含两个 ...
- 洛谷—— P1339 [USACO09OCT]热浪Heat Wave
P1339 [USACO09OCT]热浪Heat Wave 题目描述 The good folks in Texas are having a heatwave this summer. Their ...
- MAPZONE GIS SDK接入Openlayers3之一——矢量数据集接入
在选择开源前端GIS框架的时候,定下来MapBox和Openlayers3.起初被MapBox美观的地图显示效果所吸引,研究后发现其实现机制与MAPZONE GIS SDK相差深远,不如Openlay ...
- Centos: Screen tips
Install yum install screen Useful screen commands List a particular users screen sessions: screen -l ...
- zoj 月赛
Wumpus Time Limit: 2 Seconds Memory Limit: 65536 KB One day Leon finds a very classic game call ...
- 交换机是干嘛的!!交换机如何学习MAC地址过程?
1.它收到一个帧的时候,先检查源MAC地址,看看自己维护的一个地址表中有没有这个地址.如果有,则2:如果没有,则将这个MAC地址.进入的端口.进入的时间放入这个表中: 2.检查目的MAC地址,然后到该 ...
- A Taxonomy for Performance
A Taxonomy for Performance In this section, we introduce some basic performance metrics. These provi ...
- I/O虚拟化
note:这里主要记录我对IO虚拟化的理解,希望这篇文章对想了解虚拟化IO的同学有点帮助.这是我在看论文[vale,a switched ethernet for virtual machines]的 ...
- HDUPhysical Examination(贪心)
HDUPhysical Examination(贪心) 题目链接 题目大意:给N个队列,每一个队列在0时刻体检的时候完毕时间是ai.假设超过t(s),那么就是ai + t∗bi.问如何组合才干用最短的 ...
- 一款炫酷Loading动画--载入失败
简单介绍 上一篇文章一款炫酷Loading动画–载入成功.给大家介绍了成功动画的绘制过程,这篇文章将接着介绍载入失败特效的制作. 相比成功动画,有了前面的经验,失败动画的过程就显得比較简单了. 动画结 ...