在bean(可以是controller、service、dao等)中,使用@Value注解:
在spring中定义资源文件:
config.properties文件:
这样config.properties中的sytem.username就注入到loginUserName属性中了。
在bean(可以是controller、service、dao等)中,使用@Value注解:
在spring中定义资源文件:
config.properties文件:
这样config.properties中的sytem.username就注入到loginUserName属性中了。