How to reload properties with Spring?

前端 未结 6 907
甜味超标
甜味超标 2020-12-01 12:44

I\'m using properties file with Spring 3. When Spring initializes its contex it loads the properties file and puts it in all beans with @Value annotation.

I want to

6条回答
  •  Happy的楠姐
    2020-12-01 13:29

    Yes you can do this in Spring JMX way. Add these beans to your spring config file. Create a separate method to read the property file. In this sample I use callThisAgain() method.

    
        
            
                
            
        
        
            
                
                    
                        callThisAgain 
                    
                
            
        
    
    
    
        
        
    
    
    
        
    
    

    After that you can use jconsole to reload your method without restarting server.

提交回复
热议问题