properties文件使用{0}...
例如properties文件的配置
weixin.token.url=https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={0}&secret={1}
java文件中可以写成:
/**
     * 微信Token请求接口地址
     */
    @Value("${weixin.token.url}")
    private String              tokenUrl;  
String address = MessageFormat.format(tokenUrl, appId, secret);
MessageFormat类来拼接
 
                    
                     
                    
                 
                    
                
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号