Spring Boot之HelloWorld
视频网址:http://www.iqiyi.com/w_19ruksbpf1.html
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.</modelVersion> <groupId>edu.shy.javaee</groupId>
<artifactId>sprint-boot-hello</artifactId>
<version>0.0.-SNAPSHOT</version>
<packaging>jar</packaging> <name>sprint-boot-hello</name>
<url>http://maven.apache.org</url>
<!--sprint boot 父节点依赖,引入这个之后相关的引入就不需要加version配置,sprint boot 会自动选择最合适的版本进行添加 -->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4..BUILD-SNAPSHOT</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-</project.build.sourceEncoding>
<!-- 指定一下jdk的版本,这里我们 使用jdk1.,默认1. -->
<java.version>1.8</java.version>
</properties> <dependencies>
<!-- spring-boot-starter-web:MVC,AOP的依赖包 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency> <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-nop</artifactId>
<version>1.7.</version>
</dependency>
</dependencies> <!-- Package as an executable jar -->
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build> <!-- Add Spring repositories -->
<!-- (you don't need this if you are using a .RELEASE version) -->
<repositories>
<repository>
<id>spring-snapshots</id>
<url>http://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<url>http://repo.spring.io/milestone</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<url>http://repo.spring.io/snapshot</url>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<url>http://repo.spring.io/milestone</url>
</pluginRepository>
</pluginRepositories> </project>
参考:https://blog.csdn.net/lxhjh/article/details/51711148
问题:Failed to load class "org.slf4j.impl.StaticLoggerBinder"
添加配置:
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-nop</artifactId>
<version>1.7.</version>
</dependency>
参考:https://blog.csdn.net/qq_35923749/article/details/76735191
问题:Failed to start end point associated with ProtocalHandler [http-nio-8080] java.net.BindException:Address already in use :bind
SPRING-BOOT中TOMCAT端口修改
https://stackoverflow.com/questions/21083170/spring-boot-how-to-configure-port
https://www.cnblogs.com/h-ys/p/5470047.html
或
干掉进程中Java(TM) Platform SE binary
参考:https://www.cnblogs.com/onlycxue/p/3573154.html
或:
@Bean
public EmbeddedServletContainerFactory servletContainer(){
TomcatEmbeddedServletContainerFactory factory=new TomcatEmbeddedServletContainerFactory();
factory.setPort();
factory.setSessionTimeout(,TimeUnit.MINUTES);
//factory.addErrorPages(new ErrorPage(HttpStatus.Not_FOUND,"/notfund.html"));
return factory;
}
参考:
https://www.cnblogs.com/zhao1949/p/6206417.html
spring boot
spring cloud
https://www.zhihu.com/question/39483566
Spring Boot之HelloWorld的更多相关文章
- Spring Boot 之 HelloWorld详解
摘要: 原创出处:www.bysocket.com 泥瓦匠BYSocket 希望转载,保留摘要,谢谢! “以前是人放狗看家,现在是狗牵着人散步” — 随笔 一.Spring Boot 自述 世界上最好 ...
- Springboot(二):Spring Boot 之 HelloWorld
关于项目的创建不再解释,需要了解的请参考: Springboot(一):使用Intellij中的Spring Initializr来快速构建Spring Boot工程 目录结构: 首先我们在上一项目的 ...
- 借助Maven入手Spring Boot第一个程序
目前网上有不少Spring Boot的入门文章,都很有帮助,本人最近在深入学习Spring Cloud,在搭建第一个Hello World程序时,感觉对于新手而言,介绍文章怎么详细都不为过,因为其中坑 ...
- Spring Boot 集成 FreeMarker 详解案例(十五)
一.Springboot 那些事 SpringBoot 很方便的集成 FreeMarker ,DAO 数据库操作层依旧用的是 Mybatis,本文将会一步一步到来如何集成 FreeMarker 以及配 ...
- Spring Boot应用启动的三种方式
Spring Boot应用HelloWorld的三种启动方式: 项目的创建可以在http://start.spring.io/网站中进行项目的创建. 首先项目结构: 1. 通过main方法的形式启动 ...
- spring boot 初试,springboot入门,springboot helloworld例子
因为项目中使用了spring boot ,之前没接触过,所以写个helloworld玩玩看,当做springboot的一个入门例子.搜索 spring boot.得到官方地址:http://proje ...
- Spring Boot——2分钟构建spring web mvc REST风格HelloWorld
之前有一篇<5分钟构建spring web mvc REST风格HelloWorld>介绍了普通方式开发spring web mvc web service.接下来看看使用spring b ...
- [转]Spring Boot——2分钟构建spring web mvc REST风格HelloWorld
Spring Boot——2分钟构建spring web mvc REST风格HelloWorld http://projects.spring.io/spring-boot/ http://spri ...
- Spring Boot实战之逐行释义HelloWorld
一.前言 研究Spring boot也有一小段时间了,最近会将研究东西整理一下给大家分享,大概会有10~20篇左右的博客,整个系列会以一个简单的博客系统作为基础,因为光讲理论很多东西不是特别容易理解 ...
随机推荐
- 【canvas】N角光阑
这回把光阑代码统一了,修改angleCount的数目为3就是三角光阑,angleCount的数目为4就是四角光阑,angleCount的数目为6就是六角光阑,目前代码中是12角光阑. 图示: 代码: ...
- C#.NET常见问题(FAQ)-如何给Listbox添加右键菜单
1 拖一个ContextMenuStrip控件,然后可以直接在界面上编辑,也可以在FormLoad的时候动态添加 2 把这两个控件关联起来就可以实现listBox1的右键菜单跟ContextMen ...
- linux python调试技巧
Linux下Python基础调试 http://blog.163.com/liuyuhuan0915@126/blog/static/78265448201141662828820/ 当手边没有IDE ...
- UIKeyboardTypeNumberPad 数字键盘添加完成按钮
一:添加通知 //数字键盘添加完成 [[NSNotificationCenterdefaultCenter] addObserver:selfselector:@selector(keyboardWi ...
- windows下npm默认的全局路径
C:\Users\用户名\AppData\Roaming\npm\node_modules
- JVM中类的卸载机制
类的生命周期 当Sample类被载入.连接和初始化后,它的生命周期就開始了. 当代表Sample类的Class对象不再被引用,即不可触及时,Class对象就会结束生命周期.Sample类在方法区内的数 ...
- html字符转义
常用表: No. 文字表記 10進表記 16進表記 文字 Comment 001 " " " """ quotation mark ...
- 山东省赛-博弈-Game
id=1582" target="_blank" style="font-size:18px">点击打开题目链接 非常明显的一道博弈题目,可 ...
- java装箱拆箱
基本数据类型的自动装箱(autoboxing).拆箱(unboxing)是自J2SE 5.0开始提供的功能. 一般我们要创建一个类的对象的时候,我们会这样: Class a = new Class(p ...
- 启动ip wizard时报the ip wizard does not support dhcp
启动ip wizard时报the ip wizard does not support dhcp 阅读:5502012-05-11 11:15 标签:loadrunner 打开ip wizard:开始 ...