1、springboot之HelloWorld
最基本的,官网copy
创建maven项目
maven中添加
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.2.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
创建一个类
@Controller
@EnableAutoConfiguration
public class SampleController { @RequestMapping("/")
@ResponseBody
String home() {
return "Hello World!";
} public static void main(String[] args) throws Exception {
SpringApplication.run(SampleController.class, args);
}
}
运行该方法
然后浏览器中输入http://localhost:8080/
输出Hello World!说明springboot已经成功启动。
1、springboot之HelloWorld的更多相关文章
- springboot之HelloWorld
简介 为了简化开发Spring的复杂度,Spring提供了SpringBoot可以快速开发一个应用,这里就简单介绍下SpringBoot如何快速开发一个J2EE应用 HelloWorld 首先在gra ...
- SpringBoot学习helloworld
这几天开始学习springBoot记录一下(Hello World) pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0 ...
- SpringBoot的HelloWorld 应用及解释
参考链接: Spring Data JPA - Reference Documentation Spring Data JPA--参考文档 中文版 纯洁的微笑:http://www.ityouknow ...
- [一]SpringBoot 之 HelloWorld
(1)新建一个Maven Java工程 (2)在pom.xml文件中添加Spring BootMaven依赖 2.1在pom.xml中引入spring-boot-start-parent spring ...
- SpringBoot入门学习(一): Idea 创建 SpringBoot 的 HelloWorld
创建项目: 项目结构: 程序启动入口: 正式开始: package com.example.demo; import org.springframework.boot.SpringApplicatio ...
- redis整合springboot的helloworld
引入依赖 compile 'org.springframework.boot:spring-boot-starter-data-redis' 使用redis有两种方法 1.Jedis Jedis je ...
- SpringBoot——探究HelloWorld【三】
前言 前面我们写了helloworld的一个,这里我们对他进行分析 探究 那么下面就开始我们的探究之旅吧,首先从POM文件来,在POM文件中我们导入了项目所需要的依赖 POM文件 父项目 <pa ...
- spring-boot的helloWorld详解
1.运行环境 开发工具:intellij idea JDK版本:1.8 项目管理工具:Maven 3.2.5 2.Maven Plugin管理 pom.xml配置代码: <project xml ...
- eclipse springboot运行helloworld错误: 找不到或无法加载主类 xxx.xxx.xxx
这个错误,在网上搜找了好久,说是什么jar包冲突,什么环境配置,我经过验证均是正确的,javac java java -version 都没问题,环境变量也OK,各种解释均没有能够解决我的问题,最后好 ...
- SpringBoot的 HelloWorld
SpringBoot HelloWorld 功能需求 浏览器发送hello请求,服务器接收请求并处理,相应HelloWorld字符串 1.创建一个maven工程:(jar) 2.导入SpringB ...
随机推荐
- [ActionScript 3.0] AS向php发送二进制数据方法之——在URLRequest中构造HTTP协议发送数据
主类 HTTPSendPHP.as package { import com.JPEGEncoder.JPGEncoder; import com.fylib.httpRequest.HttpRequ ...
- Saiku2.6 Saiku315 链接SQL的JDBC字符串
Saiku26 type=OLAP name=CloudConn driver=mondrian.olap4j.MondrianOlap4jDriver location=jdbc:mondrian: ...
- 键盘压缩背景,ios滚动不流畅,禁止遮罩层下面内容滚动
1.<!--防止软键盘压缩页面背景图片--> <script> const bodyHeight = document.documentElement.clientHeight ...
- rest-assured之认证授权(Authentication)
rest-assured支持多种认证授权方案,比如:OAuth.digest(摘要认证).certificate(证书认证).form(表单认证)以及preemptive(抢占式基础认证)等.我们可以 ...
- C: City----逆向并查集
C: City 时间限制: 1 s 内存限制: 128 MB 题目描述 如果城市A和城市B互通,城市B和城市C互通,那么城市A和城市C也互通,A.B.C三个城市算一个聚集点.先 ...
- B: Break Prime
题目描述 给定一个素数,试判断能否将该素数写为b3−a3 的形式,a,b皆为非负整数. 输入 多组输入 每行一个素数P (2≤P≤1015) 输出 若可以分解输出a,b(a<b) ,不能输出 ...
- 【Python】批量检测百度权重
挖洞过程中收集了站点后,我一般习惯查看站点的百度权重值,为了方便,写了一个简单的脚本, 至于结果如何显示,看个人需求吧,我这里只是简单的列一下,脚本如下: #coding:utf-8 import r ...
- git特殊用法
git stash的使用 1.当前分支写了一半的代码,需要切到其他分支修复bug或者完成优先级较高的任务时 git stash 暂存分支进度 git stash list 查看草稿区 git stas ...
- linux的yum报错
yum makecache Loaded plugins: fastestmirror Could not retrieve mirrorlist http://mirrorlist.centos.o ...
- RT-Thread Nano移植
RT_Thread移植:在MDK下以组件形式提供 https://pan.baidu.com/s/1miac86O#list/path=%2Fsharelink4264488348-377157516 ...