通过main方法读取ssm项目的配置并进行对应的启动

import cn.jpp.model.*;
import cn.jpp.service.impl.AllService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

@Component
public class main {
    //读取console.xml
    private static ApplicationContext applicationContext = new ClassPathXmlApplicationContext("console.xml");
   //获取服务    
private static AllService allService=(AllService)applicationContext.getBean("allService");

    public static void main(String[] args) {
        //StInstance
        List user = allService.getList();
//        allService.insert(user);
        //XtInstance
        List oldXtInstanceList = allService.getXtInstance();
//        allService.insertXtInstance(oldXtInstanceList);
        //UT_GW_ARCHIVE_INCEPT
        List oldAchiveIncept = allService.getAchiveIncept();
//        allService.insertAchiveIncept(oldAchiveIncept);
        //ST_DYNAMIC_RESOURCE
        List oldStDynamicResourceList = allService.getResourceList();
//        allService.insertStDynamicResource(oldStDynamicResourceList);
        //st_work_item_hist
        List oldStWorkItemHistList = allService.getOldStWorkItemHist();
//        allService.insertWorkItemHistList(oldStWorkItemHistList);
        //Ut_file
        List oldFiles = allService.getOldFiles();
    }

}

 

/**console.xml



    
    

    

*/

 

/** applicationgContext.xml




    
    
        
    

    

    
        
        
        
        
    

    
    
        
        
        
        
        
    

    
    
        
        
        
        
    

    
    
        
        
    

*/

 

你可能感兴趣的:(通过main方法读取ssm项目的配置并进行对应的启动)