How to execute jobs just after spring loads application context?

后端 未结 5 1501
萌比男神i
萌比男神i 2021-02-01 03:14

I want to run some jobs just after loading the Spring context but I do not know how to do this.
Do you have any idea how to do that?

5条回答
  •  广开言路
    2021-02-01 04:06

    thank you all for your reply. In fact I missed a little detail in my question, I wanted to run Quartz Job just after loading the application context.. I tried the solution stakfeman, but I had some problems running the Quartz Jobs. Finally I found that solution: Use Quartz within Spring ,here is the code:

    
        
            
            
        
    
        
            
            
            
            
            
            
        
    
        
            
                
                    
                
            
        
    

    thank you again for the help and I apologize if the question was not very clear ':(

提交回复
热议问题