小编pl4*_*pus的帖子

spring-boot auto-configuration忽略application.yml

放在classpath根目录(src/main/resources)中.

正确使用同一位置的application.properties文件.

这是代码:

@Controller
@EnableAutoConfiguration
public class TestResource {

    @RequestMapping("/")
    public @ResponseBody Map<String, String> test() {
        return Collections.singletonMap("text", "test text");
    }

    public static void main(String[] args) {
        SpringApplication.run(TestResource.class, args);
    }

}
Run Code Online (Sandbox Code Playgroud)

spring-boot

1
推荐指数
1
解决办法
1566
查看次数

标签 统计

spring-boot ×1