Spring常用测试代码

Spring常用测试代码(DaoImpl);
public static void main(String[] args) throws Exception {
ApplicationContext context=new ClassPathXmlApplicationContext(new String[]{"applicationContext.xml"});
SendMsgDao ud=(SendMsgDao)context.getBean("sendMsgDaoImpl");
System.out.println(ud.getClass().getSimpleName());
SendMsg sm=new SendMsg();
sm.setTitle("1");
ud.add(sm);
}

你可能感兴趣的:(spring)