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

📄 pagesave_jsp.java

📁 在线考试系统
💻 JAVA
字号:
package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.sql.*;

public final class pagesave_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static java.util.List _jspx_dependants;

  public Object getDependants() {
    return _jspx_dependants;
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    JspFactory _jspxFactory = null;
    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;


    try {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html; charset=gb2312");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			"", true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\r\n");
      out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\r\n");
      out.write("<html>\r\n");
      out.write("<head>\r\n");
      out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n");
      out.write("<title>保存试题</title>\r\n");
      out.write("</head>\r\n");
      myexam.myexam addquest = null;
      synchronized (_jspx_page_context) {
        addquest = (myexam.myexam) _jspx_page_context.getAttribute("addquest", PageContext.PAGE_SCOPE);
        if (addquest == null){
          addquest = new myexam.myexam();
          _jspx_page_context.setAttribute("addquest", addquest, PageContext.PAGE_SCOPE);
        }
      }
      out.write('\r');
      out.write('\n');
      myexam.myexam addstorer1 = null;
      synchronized (_jspx_page_context) {
        addstorer1 = (myexam.myexam) _jspx_page_context.getAttribute("addstorer1", PageContext.PAGE_SCOPE);
        if (addstorer1 == null){
          addstorer1 = new myexam.myexam();
          _jspx_page_context.setAttribute("addstorer1", addstorer1, PageContext.PAGE_SCOPE);
        }
      }
      out.write('\r');
      out.write('\n');
      myexam.myexam addstorer2 = null;
      synchronized (_jspx_page_context) {
        addstorer2 = (myexam.myexam) _jspx_page_context.getAttribute("addstorer2", PageContext.PAGE_SCOPE);
        if (addstorer2 == null){
          addstorer2 = new myexam.myexam();
          _jspx_page_context.setAttribute("addstorer2", addstorer2, PageContext.PAGE_SCOPE);
        }
      }
      out.write('\r');
      out.write('\n');
      myexam.myexam addstorer3 = null;
      synchronized (_jspx_page_context) {
        addstorer3 = (myexam.myexam) _jspx_page_context.getAttribute("addstorer3", PageContext.PAGE_SCOPE);
        if (addstorer3 == null){
          addstorer3 = new myexam.myexam();
          _jspx_page_context.setAttribute("addstorer3", addstorer3, PageContext.PAGE_SCOPE);
        }
      }
      out.write('\r');
      out.write('\n');
      myexam.myexam addstorer4 = null;
      synchronized (_jspx_page_context) {
        addstorer4 = (myexam.myexam) _jspx_page_context.getAttribute("addstorer4", PageContext.PAGE_SCOPE);
        if (addstorer4 == null){
          addstorer4 = new myexam.myexam();
          _jspx_page_context.setAttribute("addstorer4", addstorer4, PageContext.PAGE_SCOPE);
        }
      }
      out.write("\r\n");
      out.write("\r\n");
      out.write("<body>\r\n");

  String sbname=(String)session.getAttribute("subname1");
  String sbnum1=(String)session.getAttribute("sbno1");
  int sbnum=Integer.parseInt(sbnum1);
  String hpage1=(String)session.getAttribute("hpage");
  int haspage=Integer.parseInt(hpage1);
  int pnum=haspage+1;
  String qnum1=request.getParameter("qno");
  int qnum=Integer.parseInt(qnum1);
  String question=new String(request.getParameter("question").getBytes("ISO-8859-1"));
  String keys=request.getParameter("keys");
  String type1=request.getParameter("type");
  int type=Integer.parseInt(type1);
  String sql1="insert into question values ("+sbnum+","+pnum+","+qnum+",'"+question+"',"+type+",'"+keys+"')";
  addquest.executeUpdate(sql1);
  if(type!=3){
     String answera=new String(request.getParameter("A").getBytes("ISO-8859-1"));
	 String sql2="insert into storer values ("+sbnum+","+pnum+","+qnum+",'A','"+answera+"')";
	 addstorer1.executeUpdate(sql2);
	 String answerb=new String(request.getParameter("B").getBytes("ISO-8859-1"));
	 String sql3="insert into storer values ("+sbnum+","+pnum+","+qnum+",'B','"+answerb+"')";
	 addstorer2.executeUpdate(sql3);
	 String answerc=new String(request.getParameter("C").getBytes("ISO-8859-1"));
	 String sql4="insert into storer values ("+sbnum+","+pnum+","+qnum+",'C','"+answerc+"')";
	 addstorer3.executeUpdate(sql4);
	 String answerd=new String(request.getParameter("D").getBytes("ISO-8859-1"));
	 String sql5="insert into storer values ("+sbnum+","+pnum+","+qnum+",'D','"+answerd+"')";
	 addstorer4.executeUpdate(sql5);
  }
  if(qnum==1){
    response.sendRedirect("pageend.jsp");
  }
  else{
    response.sendRedirect("tpage1.jsp");
  }

      out.write("\r\n");
      out.write("</body>\r\n");
      out.write("</html>\r\n");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          out.clearBuffer();
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}

⌨️ 快捷键说明

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