一、spring-boot-devtools

  在pom中直接引入依赖



<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>


  设置以下两项(第一项如已设置直接设置第二项)

 

    1) “File” -> “Settings” -> “Build,Execution,Deplyment” -> “Compiler”,选中打勾 “Build project automatically” 。

 

 2) 组合键:“Shift+Ctrl+Alt+/” ,选择 “Registry” ,选中打勾 “compiler.automake.allow.when.app.running” 


 

javaWeb项目intellij idea更改js文件或者jsp需重启项目

我们注意一下红框,一定要打钩,自动build项目,但是这还不算完,我们spring boot的资源文件一般是放在resource里面的,但是resource里不包含js文件的参数,这需要我们自己加上,如下图:


springboot html修改后不重启生效_spring

 

 






ok,这就行啦,修改js文件后会立马生效不用重启