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

📄 chuti_jsp.java

📁 用java写的一个简单的在线考试系统
💻 JAVA
字号:
package org.apache.jsp;

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

public final class chuti_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("\r\n");
      out.write("\r\n");
      out.write("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n");
      out.write("<html xmlns=\"http://www.w3.org/1999/xhtml\">\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("<style type=\"text/css\">\r\n");
      out.write("<!--\r\n");
      out.write("#Layer1 {\r\n");
      out.write("\tposition:absolute;\r\n");
      out.write("\tleft:225px;\r\n");
      out.write("\ttop:232px;\r\n");
      out.write("\twidth:786px;\r\n");
      out.write("\theight:405px;\r\n");
      out.write("\tz-index:1;\r\n");
      out.write("}\r\n");
      out.write("#Layer2 {\r\n");
      out.write("\tposition:absolute;\r\n");
      out.write("\tleft:225px;\r\n");
      out.write("\ttop:250px;\r\n");
      out.write("\twidth:774px;\r\n");
      out.write("\theight:376px;\r\n");
      out.write("\tz-index:2;\r\n");
      out.write("}\r\n");
      out.write(".STYLE4 {\r\n");
      out.write("\tcolor: #0000FF;\r\n");
      out.write("\tfont-size: x-large;\r\n");
      out.write("}\r\n");
      out.write("body {\r\n");
      out.write("\tbackground-color: #00FF66;\r\n");
      out.write("}\r\n");
      out.write("-->\r\n");
      out.write("</style>\r\n");
      out.write("</head>\r\n");
      out.write("<body>\r\n");
      out.write("   \r\n");
      out.write(" <table width=\"724\" height=\"242\" border=\"1\">\r\n");
      out.write("  <tr>\r\n");
      out.write("    <td height=\"210\" colspan=\"2\"><img src=\"images/top.png\" width=\"1000\" height=\"200\" border=\"0\" usemap=\"#Map\" /></td>\r\n");
      out.write("  </tr>\r\n");
      out.write("  <tr>\r\n");
      out.write("    <td width=\"201\"><a href=\"yonghucontrol.jsp\"></a><img src=\"images/xingleftpage.png\" alt=\"\" width=\"200\" height=\"400\" border=\"0\" usemap=\"#Map2\" /></td>\r\n");
      out.write("    <td width=\"793\"><table width=\"792\" height=\"394\" border=\"1\">\r\n");
      out.write("      <tr>\r\n");
      out.write("        <td width=\"361\" height=\"388\"><form id=\"form1\" name=\"form1\" method=\"post\" action=\"dealchuti.jsp\">\r\n");
      out.write("          <label for=\"textfield\"><br />\r\n");
      out.write("          选择题<br />\r\n");
      out.write("          <br />\r\n");
      out.write("          题干:</label>\r\n");
      out.write("          <input type=\"text\" name=\"xuanze\" id=\"textfield\" />\r\n");
      out.write("          <label for=\"label\"><br />\r\n");
      out.write("          <br>\r\n");
      out.write("          A &nbsp;&nbsp;</label>\r\n");
      out.write("          <input type=\"text\" name=\"a\" id=\"label\" />\r\n");
      out.write("          <label><br />\r\n");
      out.write("          <br>B&nbsp;&nbsp;&nbsp;\r\n");
      out.write("          <input type=\"text\" name=\"b\" />\r\n");
      out.write("          </label>\r\n");
      out.write("          <p>\r\n");
      out.write("            <label>C&nbsp;&nbsp;&nbsp;\r\n");
      out.write("            <input type=\"text\" name=\"c\" />\r\n");
      out.write("            </label>\r\n");
      out.write("          </p>\r\n");
      out.write("          <p>\r\n");
      out.write("            <label>D&nbsp;&nbsp;&nbsp;\r\n");
      out.write("            <input type=\"text\" name=\"d\" />\r\n");
      out.write("            </label>\r\n");
      out.write("          </p>\r\n");
      out.write("          <p>\r\n");
      out.write("            <label>选择科目\r\n");
      out.write("            <select name=\"select1\">\r\n");
      out.write("            ");

            try
       { 
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
       Connection con1=DriverManager.getConnection("jdbc:odbc:xing");
       String strkemu="select * from a ";
       PreparedStatement pre1=con1.prepareStatement(strkemu);
       ResultSet set=pre1.executeQuery();
       while(set.next())
           {
               
      out.write("\r\n");
      out.write("                    <option>");
      out.print(set.getString(2));
      out.write("</option>\r\n");
      out.write("                    ");

             }
          set.close();
          pre1.close();
          con1.close();
         
             }catch(Exception e)
             {
                 out.println(e.getMessage());
             }   
            
      out.write("\r\n");
      out.write("            </select>\r\n");
      out.write("            </label>\r\n");
      out.write("          </p>\r\n");
      out.write("          <p>\r\n");
      out.write("            <label>正确答案\r\n");
      out.write("            <select name=\"abcd\">\r\n");
      out.write("              <option>A</option>\r\n");
      out.write("              <option>B</option>\r\n");
      out.write("              <option>C</option>\r\n");
      out.write("              <option>D</option>\r\n");
      out.write("            </select>\r\n");
      out.write("            </label>\r\n");
      out.write("          </p>\r\n");
      out.write("          <p>\r\n");
      out.write("            <label>录入\r\n");
      out.write("            <input type=\"submit\" name=\"Submit\" value=\"提交\" />\r\n");
      out.write("            </label>\r\n");
      out.write("          </p>\r\n");
      out.write("        </form>        </td>\r\n");
      out.write("        <td width=\"415\"><form id=\"form2\" name=\"form2\" method=\"post\" action=\"dealchuti.jsp\">\r\n");
      out.write("          <label><br />\r\n");
      out.write("          简答题<br />\r\n");
      out.write("          <br />\r\n");
      out.write("          题干:<br />\r\n");
      out.write("          <textarea name=\"jianda\" rows=\"10\">\r\n");
      out.write("</textarea>\r\n");
      out.write("          </label>\r\n");
      out.write("          <p>\r\n");
      out.write("            <label>选择科目\r\n");
      out.write("            <select name=\"select2\">\r\n");
      out.write("              ");

            try
       { 
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
       Connection con1=DriverManager.getConnection("jdbc:odbc:xing");
       String strkemu="select * from a ";
       PreparedStatement pre1=con1.prepareStatement(strkemu);
       ResultSet set=pre1.executeQuery();
       while(set.next())
           {
               
      out.write("\r\n");
      out.write("                    <option>");
      out.print(set.getString(1));
      out.write("</option>\r\n");
      out.write("                    ");

             }
          set.close();
          pre1.close();
          con1.close();
         
             }catch(Exception e)
             {
                 out.println(e.getMessage());
             }   
            
      out.write("\r\n");
      out.write("            </select>\r\n");
      out.write("            </label>\r\n");
      out.write("          </p>\r\n");
      out.write("          <p>\r\n");
      out.write("            <label>正确答案\r\n");
      out.write("            <textarea name=\"cor\"></textarea>\r\n");
      out.write("            </label>\r\n");
      out.write("          </p>\r\n");
      out.write("          <p>\r\n");
      out.write("            <label>录入\r\n");
      out.write("            <input type=\"submit\" name=\"Submit2\" value=\"提交\" />\r\n");
      out.write("            </label>\r\n");
      out.write("          </p>\r\n");
      out.write("        </form>                </td>\r\n");
      out.write("        </tr>\r\n");
      out.write("    </table></td>\r\n");
      out.write("  </tr>\r\n");
      out.write("</table>\r\n");
      out.write("\r\n");
      out.write("<map name=\"Map\" id=\"Map\"><area shape=\"rect\" coords=\"730,17,839,46\" href=\"login.jsp\" />\r\n");
      out.write("</map>\r\n");
      out.write("\r\n");
      out.write("<map name=\"Map2\" id=\"Map2\"><area shape=\"rect\" coords=\"23,25,174,65\" href=\"chuti.jsp\" />\r\n");
      out.write("<area shape=\"rect\" coords=\"25,78,171,115\" href=\"newshitiguanli.jsp\" /><area shape=\"rect\" coords=\"28,130,167,161\" href=\"kaoshiguanli.jsp\" target=\"_parent\" />\r\n");
      out.write("<area shape=\"rect\" coords=\"30,264,166,293\" href=\"Messagecon.jsp\" />\r\n");
      out.write("<area shape=\"rect\" coords=\"31,316,58,327\" href=\"#\" /><area shape=\"rect\" coords=\"31,310,167,342\" href=\"yonghucontrol.jsp\" />\r\n");
      out.write("</map></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 + -