Spring Environment object gets Properties

String [] = activeProfiles env.getActiveProfiles (); // Get the current which is to enable all configuration files 
        System.out.println (Arrays.toString (activeProfiles));
        String[] defaultProfiles = env.getDefaultProfiles();
        System.out.println (Arrays.toString (defaultProfiles)); // defualt 
        System.out.println (env.containsProperty ( "android_last_version")); // if the file contains android_last_version attributes 
        System.out.println (env.getProperty ( "ios_force_update")); // get the property value

 

Guess you like

Origin www.cnblogs.com/yangxiaohui227/p/11322578.html