玩转 Spring Boot 原理篇(自动装配前凑之自定义Stater)
Posted 一猿小讲
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了玩转 Spring Boot 原理篇(自动装配前凑之自定义Stater)相关的知识,希望对你有一定的参考价值。
的 pom 文件中可以看出,mybatis-spring-boot-starter 包会自动引入 mybatis-spring-boot-autoconfigure 以及 mybatis 相关依赖包。
SqlSessionFactory Exception
logger.debug(
encoding= xmlns:xsi= xsi:schemaLocation= <modelVersion> <groupId>org.example</groupId>
<artifactId>game-spring-boot-starter</artifactId>
<version> <parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version> </parent>
<properties>
<maven.compiler.source> <maven.compiler.target> </properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
</dependencies>
* 猜数游戏Service
**/
String number)
gen = ( gen == number ? gen + : + gen +
* 配置类
**/
@ public GameService gameService()
@ private GameService gameService;
@ public String say(@RequestParam(name =
com.example.demo_jpa;
org.springframework.boot.SpringApplication;
org.springframework.boot.autoconfigure.SpringBootApplication;
SpringApplication.run(GameApplication.class, args);
4. 玩一玩
运行GameApplication,浏览器访问 http://localhost:8080/guess?number=300,效果如下