问答详情
源自:3-4 显示学生资料-实现显示学生资料Action

为什么session会报错,视频中没有啊

package com.zsq.action;

import java.util.List;

import org.hibernate.Session;

import serviceImpl.StudentsDAOImpl;

import com.opensymphony.xwork2.ActionSupport;
import com.zsq.entity.Students;
import com.zsq.service.StudentsDAO;

public class StudentsAction extends ActionSupport {

	private static final long serialVersionUID = 1L;

	public String query() {
		StudentsDAO sdao = new StudentsDAOImpl();
		List<Students> list = sdao.queryAllStudents();

		if (list != null && list.size() > 0) {
			session.setAttribute("students_list", list);
			return "Students_query_success";
		}

	}
}


提问者:ONLY14 2016-06-19 15:45

个回答

  • ONLY14
    2016-06-19 15:51:36

    知道了,谢谢