0
点赞
收藏
分享

微信扫一扫

SpringBoot: ConditionalOnExpression

月孛星君 2022-07-27 阅读 19



package tju.SpringBootSecurityJdbc.controller;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;@RestController
@ConditionalOnExpression("’KaTeX parse error: Expected 'EOF', got '&' at position 18: …om.abc}'=='fgh'&̲&{my.user.num}==2&&${test.fgh.enabled:true}")
public class AppController2 {
@RequestMapping("/halu")
public String testme()
{
return “this is rest!”;
}}

2. application.properties
test.fgh.enabled=true
my.user.num=2

    举报

    相关推荐

    0 条评论