<bean id="factory" class="Staticfactory"></bean>
<bean id="student" factory-bean="factory" factory-method="getstudent">
//–使用
construtor-arg 元素为工厂方法传递方法参数
<constructor-arg value="001"></constructor-arg>
</bean>
2.
class Staticfactory{
private static Map<String,Student> map=new HashMap();
static{
map.put("001",new Student("001","男","张三"));
map.put("002",new Student("002","男","李四"));
}
public Student getstudent(String stuno){
Student student=map.get("001");
return student;
}
}
class Student{
public String stuno;
public String name;
public String sex;
public Student(String stuno,S