scorepageaction.java

来自「这是一个学校老师和学生的管理系统,程序比较简单,但是几乎所有功能都可以实现,如果」· Java 代码 · 共 76 行

JAVA
76
字号
/**
 *******************************************************************************
 * ScorePageAction.java
 *
 * (c) Copyright 2008 Hewlett-Packard Development Company, L.P.
 *
 *<Program Content>
 *  System Name : Students Management System
 *<Summarize>
 *  The file includes a class and the class main funciton is to go to the query 
 *  score page.
 *<Update Record>
 *  2009-4-29    1.00    zhangliy
 *******************************************************************************
 */
package com.hp.eds.zhangliyuan.stuMan.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.springframework.web.struts.ActionSupport;

import com.hp.eds.zhangliyuan.stuMan.consts.PageConsts;
import com.hp.eds.zhangliyuan.stuMan.entity.UserInfo;
import com.hp.eds.zhangliyuan.stuMan.service.interf.StudentServiceInt;

/**
 * The class main funciton is to go to the query score page.
 * 
 * @author zhangliy
 * @version 1.0
 */
public class ScorePageAction extends ActionSupport {

	/**
	 * go to the score page
	 * 
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return ActionForward
	 * @throws Exception
	 * @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping,
	 *      org.apache.struts.action.ActionForm,
	 *      javax.servlet.http.HttpServletRequest,
	 *      javax.servlet.http.HttpServletResponse)
	 */
	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		HttpSession session = request.getSession();
		UserInfo user = (UserInfo) session
				.getAttribute(PageConsts.LOGIN_SUCCESS_SESSION_MASSAGE);
		String userID = user.getStuId();
		StudentServiceInt studentService = (StudentServiceInt) this
		.getWebApplicationContext().getBean("studentServiceInt");
		List list = studentService.getScoreList(userID);
		if (list != null) {
			request.setAttribute(PageConsts.SCORE_LIST, list);
		} else {
			request.setAttribute(PageConsts.SCORE_REQEUST,
					PageConsts.SCORE_NULL_MESSATE);
		}
		return mapping.findForward(PageConsts.STUMENU_SCORE);
	}

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?