Spring Boot 要点--启动类和热部署
spring boot需要一个启动类 比如
package com.tianmaying; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan; @SpringBootApplication
@ServletComponentScan
public class BlogApplication { public static void main(String[] args) throws Exception {
SpringApplication.run(BlogApplication.class, args);
} }
Servlet类所在的包路径必须是BlogApplication所在的包路径的子路径才能被扫描到,否则需要通过basePackages属性指定Servlet类所在的包。
2、让Spring Boot项目支持热部署,在maven配置文件添加如下依赖:
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
</dependencies>
Spring Boot 要点--启动类和热部署的更多相关文章
- spring boot (三): 热部署
介绍了Spring boot实现热部署的两种方式,这两种方法分别是使用 Spring Loaded和使用spring-boot-devtools进行热部署. 热部署是什么 大家都知道在项目开发过程中, ...
- Spring Boot SpringApplication启动类(二)
目录 前言 1.起源 2.SpringApplication 运行阶段 2.1 SpringApplicationRunListeners 结构 2.1.1 SpringApplicationRunL ...
- Spring Boot在开发时实现热部署(开发时修改文件保存后自动重启应用)(spring-boot-devtools)
热部署是什么 大家都知道在项目开发过程中,常常会改动页面数据或者修改数据结构,为了显示改动效果,往往需要重启应用查看改变效果,其实就是重新编译生成了新的Class文件,这个文件里记录着和代码等对应的各 ...
- 【spring boot】启动类启动 错误: 找不到或无法加载主类 com.codingapi.tm.TxManagerApplication 的解决方案
导入的一个外部的spring boot项目,运行启动类,出现错误:找不到或无法加载主类 com.codingapi.tm.TxManagerApplication 解决方案: 将所有错误处理完成后,再 ...
- Spring Boot SpringApplication启动类(一)
目录 目录 前言 1.起源 2.SpringApplication 准备阶段 2.1.推断 Web 应用类型 2.2.加载应用上下文初始器 ApplicationContextInitializer ...
- 使用eclipse,对spring boot 进行springloader或者devtool热部署失败处理方法
确定配置进行依赖和配置没有错误后. 调整spring boot 的版本,因为新版本对老版本的spring boot 不能使用. 改为: <groupId>org.springframewo ...
- Spring boot 解析jsp支持jsp热部署
解析jsp并且支持jsp热部署 参考地址:https://www.wanpishe.top/detail?blogId=39875536-7d45-48ec-a7b5-f36b85c3a235
- spring boot+ Intellj idea devtools 设置热部署
POM文件 <!--添加依赖--> <dependency> <groupId>org.springframework.boot</groupId> & ...
- Spring Boot学习笔记(三)实现热部署
pom文件中添加如下依赖即可 <dependency> <groupId>org.springframework.boot</groupId> <artifa ...
随机推荐
- DB2常用函数详解
(一) 字符串函数 VALUE函数 语法:VALUE(EXPRESSION1,EXPRESSION2) VALUE函数是用返回一个非空的值,当其第一个参数非空,直接返回该参数的值,如果第一个参数为空 ...
- React搭建脚手架
npm install -g create-react-app //安装 create-react-app react-demo // react-demo 项目的名称 cd react- ...
- 一个容易被忽视的css选择器
之前学的的迷糊了,也不知道什么会什么不会了,跑去面试了.别人列出一堆css选择器,本以为选择器没啥的,结果到那个多类选择器翻车了,.a.b选择同时含a,b类名的,很尴尬所以回来仔细整理了一下.目前根据 ...
- 流媒体 6——MPEG电视
1.电视图像的数据率 1.1 ITU-R BT.601标准数据率 按照奈奎斯特(Nyquist)采样理论,模拟电视信号经过采样(把连续的时间信号变成离散的时间信号)和量化 (把连续的幅度变成离散的幅度 ...
- idea搭建ssm
第一步:打开intellij idea,创建maven项目 参考:http://blog.csdn.net/w8897282/article/details/71173211 1.创建一个maven ...
- ios 几种快速写法
//NSString .... NSString *str1 = @"str1"; NSLog(@"str %@",str1); //NSArray NSArr ...
- IOS 旋转+缩放(手势识别)
@interface NJViewController ()<UIGestureRecognizerDelegate> @property (weak, nonatomic) IBOutl ...
- Java jvm 内存回收机制
http://blog.csdn.net/yaerfeng/article/details/51291903 在Java中,它的内存管理包括两方面:内存分配(创建Java对象的时候)和内存回收,这两方 ...
- numpy.random.shuffle(x)的用法
numpy.random.shuffle(x) Modify a sequence in-place by shuffling its contents. Parameters: x : array_ ...
- datetime 插件
1 写一段文本 <div id="nomarl-wrap"> <div class="form-group"> <label c ...