struts2.0 整合spring的时候 JAVABEAN装配不完全 为什么?

来源:百度知道 编辑:UC知道 时间:2024/05/26 15:05:35
public class RegestAction extends ActionSupport {

private Student student;

private StudentService studentService;

public void setStudent(Student student) {
this.student = student;
System.out.println(student.getTelephone()+" setStudent");
}

public void setStudentService(StudentService studentService) {
this.studentService = studentService;
}

@Override
public String execute() throws Exception {
studentService.saveStudent(student);
return SUCCESS;
}
被驻入的student只有一个属性有值 其他的为NULL

private Student student;
你打算怎么注入?
student 一半是从前台直接传值过来的吧,貌似不需要从spring注入吧

即使注入的话 也是直接在spring的配置文件中,依次注入所有的值,你吧你的配置文件贴出来,估计是你写错了,或者对spring理解错了