@value injection, when the configuration file cannot be submitted
If the configuration file of a multi-person collaborative development project is not submitted, it will cause the startup of other people’s projects to fail. You can provide a default value for the class attribute @value
1
2
3
4
5
|
//The null value is wrapped in #{}, if not parsed as a string by default @Value ( "${cpris.docRootPath:#{null}}" ) private String rootPath; @Value ( "${cpris.ip:1}" ) private String ip; |