老师看一下为什么我的报错了
debug: false logging: level: root: error file: e:/myspringboot.log spring: datasource: driver-class-name: com.mysql.jdbc.Driver url: jdbc:mysql://localhost:3306/test username: root password: lj1995311 mall: cofig: name: 暧昧商场 describe: 化妆品网站 hot_class: 20 show-advert: true
package com.imooc.myspringboot.controller; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @Controller public class MyController { @Value("${mall.config.name}") private String name; @Value("${mall.config.describe}") private String describe; @Value("${mall.config.hot_class}") private Integer hot_class; @Value("${mall.config.show-advert}") private Boolean showAdvert; @RequestMapping("/out") @ResponseBody public String out() { return "success"; } @RequestMapping("/info") @ResponseBody public String info(){ return String.format("name:%s,describe:%s,hot_class:%s,hot_class:%s,show-advert%s", name,describe,hot_class,showAdvert); } }
package com.imooc.myspringboot.controller; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; //说明这是一个SpringBoot应用的入口类 @SpringBootApplication public class MYSpringBootApplication { public static void main(String[] args) { //启动SpringBoot应用 SpringApplication.run(MYSpringBootApplication.class); } }
1
收起
正在回答 回答被采纳积分+1
SSM主流框架入门与综合项目实战2018版
- 参与学习 人
- 提交作业 205 份
- 解答问题 4317 个
Java中非常实用的SSM整合开发内容,从Spring开始,到MyBaits的进阶内容,再到SpringMVC的应用,最后是SSM整合开发案例,逐步深入,助你成长为一名Java工程师!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星