⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 enterexamaction.java

📁 采用Eclispe开发平台
💻 JAVA
字号:
package com.whatratimes.webedu.student;

import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.Action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.util.Hashtable;

/**
 * User: Tao
 * Date: Jun 15, 2003
 * Time: 7:06:48 AM
 */
public class EnterExamAction extends Action
{
    public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception
    {
        String assign_id = httpServletRequest.getParameter("AssignmentId");

        if (assign_id == null)
        {
            return actionMapping.findForward("back");
        }

        Hashtable this_assign = null;

        HttpSession session = httpServletRequest.getSession();

        Object[] objs = (Object[]) session.getAttribute("ExamTable");

        for (int i = 0; i < objs.length; i++)
        {
            Hashtable h = (Hashtable) objs[i];
            if (Integer.valueOf(assign_id).equals(h.get("AssignmentId")))
            {
                this_assign = h;
                break;
            }
        }

        if ( this_assign == null )
        {
            return actionMapping.findForward("back");
        }

        session.setAttribute("CurrentAssignment", this_assign);

        httpServletResponse.setHeader("Cache-Control","no-cache");
        httpServletResponse.setHeader("Pragma","no-cache");
        httpServletResponse.setDateHeader ("Expires", 0);

        return actionMapping.findForward("success");
    }
}

⌨️ 快捷键说明

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