boundingbox 2016-03-10 13:24 采纳率: 20%
浏览 1392

struts2跳转,出错,是action无法加载跳转吗

图片说明
错误信息是这个

我的action中这样写的


        <!-- 增加学生的方法 -->
        <action name="addStudentAction" class="addStudentAction" method="addStudentAction">
            <result name="success" type="redirect">student.jsp</result>
            <result name="error">error.jsp</result>
        </action>

action代码这样的

 package com.yzj.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.opensymphony.xwork2.ActionSupport;
import com.yzj.model.Student;
import com.yzj.service.StudentService;

@Component("studentAction")
@Scope("prototype")
public class StudentAction  extends ActionSupport {
    HttpServletRequest request;
    private StudentService studentService;
    private String username;
    private List<Student> student;
    private Student stu;


    public Student getStu() {
        return stu;
    }
    public void setStu(Student stu) {
        this.stu = stu;
    }
    public HttpServletRequest getRequest() {
        return request;
    }
    public void setRequest(HttpServletRequest request) {
        this.request = request;
    }

    public List<Student> getStudent() {
        return student;
    }
    public void setStudent(List<Student> student) {
        this.student = student;
    }
    public StudentService getStudentService() {
        return studentService;
    }
    public void setStudentService(StudentService studentService) {
        this.studentService = studentService;
    }
    public String getUsername() {
        return username;
    }
    public void setUsername(String username) {
        this.username = username;
    }


    public String findAllStudent() {
        System.out.println("000000000000000");
        student = studentService.findAllStudent();
        System.out.println("111111111111111111");
        if (student != null && student.size() > 0 ) {

            return "success";
        }
        return "error";
    }
}

不知道怎么回事,求大神!!

  • 写回答

7条回答 默认 最新

  • jiar2046 2016-03-10 13:30
    关注

    配置action的class应该是完整的类名。

    评论

报告相同问题?

悬赏问题

  • ¥30 STM32 INMP441无法读取数据
  • ¥100 求汇川机器人IRCB300控制器和示教器同版本升级固件文件升级包
  • ¥15 用visualstudio2022创建vue项目后无法启动
  • ¥15 x趋于0时tanx-sinx极限可以拆开算吗
  • ¥500 把面具戴到人脸上,请大家贡献智慧
  • ¥15 任意一个散点图自己下载其js脚本文件并做成独立的案例页面,不要作在线的,要离线状态。
  • ¥15 各位 帮我看看如何写代码,打出来的图形要和如下图呈现的一样,急
  • ¥30 c#打开word开启修订并实时显示批注
  • ¥15 如何解决ldsc的这条报错/index error
  • ¥15 VS2022+WDK驱动开发环境