你把/WEB-INF/classes/applicationContext.xml改为classpath:applicationContext.xml试一试,还有就是你得测试下你的studentDAO是否为null,再判断是否注入,到底是没有注入还是你的action自己写得有问题,里面是有有set方法!!。

解决方案 »

  1.   

    StudentAction.java:43。。这个类的43行代码出现了空异常。你可以去查看一下这行代码。这里没贴出来
      

  2.   


    applicationContext.xml这个文件必须放在classes目录下才能这应改,否则继续报错。
    StudentAction.java:43。。这个类的43行代码出现了空异常。你可以去查看一下这行代码。这里没贴出来
    这个才是正解
      

  3.   


    private StudentService studentService;

    public void setStudentService(StudentService studentService) {
    this.studentService = studentService;
    }set方法应该没问题
      

  4.   

    <action path="/studentAction" type="org.springframework.web.struts.DelegatingActionProxy"></action>
    检查一下你的struts文件是不是这样配的,你的ssh集成时,struts文件有没有这个配置:
    <plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
       <set-property property="contextConfigLocation" value="你的spring文件路径(多个文件用逗号隔开)"/>
      </plug-in>自己再检查一下
      

  5.   


    <bean name="/studentAction" class="com.grace.studentGradeManage.action.StudentAction">
            <property name="studentService">
                <ref bean="studentService"/>
            </property>
        
    </bean>最后一个<bean>怎么用的name,没有id
      

  6.   

    看报错 你是loginAction 46行空指针,你是这里调用Service的吧,也没有看到你把Service注入到Action的代码,检测下是不是注入了这个,参考:www.yishish.com
      

  7.   

    你确定框架导入了strut2-spring-plugin.jar包么
      

  8.   


    at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)典型的struts1,你让她导这个包,有嘛意义?