enterpracticepaperaction.java

来自「采用Eclispe开发平台」· Java 代码 · 共 39 行

JAVA
39
字号
package com.whatratimes.webedu.student;

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

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

/**
 * User: Tao
 * Date: Jun 17, 2003
 * Time: 2:21:48 AM
 */
public class EnterPracticePaperAction extends Action
{
    public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception
    {

        HttpSession session = httpServletRequest.getSession();

        int total = ((Object[])session.getAttribute("Questions")).length;

        Integer submit_id = (Integer) session.getAttribute("SubmitId");

        DynaValidatorActionForm form = (DynaValidatorActionForm) actionForm;

        form.initialize(actionMapping);
        form.set("SubmitId", submit_id);
        form.set("Total", new Integer(total));

        return actionMapping.findForward("success");
    }

}

⌨️ 快捷键说明

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