如何配置 springboot

1、pom.xml中添加支持web的模块:

<dependency>        <groupId>org.springframework.boot</groupId>        <artifactId>spring-boot-starter-web</artifactId> </dependency>
pom.xml文件中默认有两个模块:
spring-boot-starter
spring-boot-starter-test
2、编写controller内容
@RestController的意思就是controller里面的方法都以json格式输出,不用再写什么jackjson配置的了!

开发环境的调试
热启动在正常开发项目中已经很常见了吧,虽然平时开发web项目过程中,改动项目启重启总是报错;
但springBoot对调试支持很好,修改之后可以实时生效,需要添加以下的配置:

<dependencies>

<dependency>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-devtools</artifactId>

<optional>true</optional>

</dependency>

</dependencies>

<build>

<plugins>

<plugin>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-maven-plugin</artifactId>

<configuration>

<fork>true</fork>

</configuration>

</plugin>

</plugins>

</build>

不做任何解释。没有人明白,

如何配置 springboot

相关文章:

你感兴趣的文章:

标签云: