1234567891011121314151617181920212223 |
- package com.lemon.lifecenter.common;
- import org.springframework.context.ApplicationContext;
- public class PropertyUtil {
- public static String getProperty(String propertyName) {
- return getProperty(propertyName, null);
- }
-
- public static String getProperty(String propertyName, String defaultValue) {
- String value = defaultValue;
- ApplicationContext applicationContext = ApplicationContextServe.getApplicationContext();
-
- if(applicationContext.getEnvironment().getProperty(propertyName) == null) {
-
- } else {
- value = applicationContext.getEnvironment().getProperty(propertyName).toString();
- }
-
- return value;
- }
- }
|