怎样在小程序里实现标题的更改
822
2022-10-14
Spring_使用XML配置文件创建对象
package com.bjsxt.spring;public interface BeanFactory { public Object getBean(String name);}
package com.bjsxt.spring;import java.util.HashMap;import java.util.List;import java.util.Map;import org.jdom2.Document;import org.jdom2.Element;import org.jdom2.input.SAXBuilder;public class ClassPathXmlApplicationContext implements BeanFactory { private Map
package com.bjsxt.service;import org.junit.Test;import com.bjsxt.dao.UserDao;import com.bjsxt.model.User;import com.bjsxt.spring.BeanFactory;import com.bjsxt.spring.ClassPathXmlApplicationContext;public class UserServiceTest { @Test public void testAdd() throws Exception { BeanFactory factory = new ClassPathXmlApplicationContext(); UserService service = new UserService(); UserDao ud = (UserDao) factory.getBean("u"); service.setUd(ud); User user = new User(); service.add(user); }}
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~