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=GBK");
      pageContext = _jspxFactory.getPageContext(this, request, response, null, 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("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");

      int id = Integer.parseInt(request.getParameter("id"));
      String name = request.getParameter("name");
      String xuehao = request.getParameter("number");
      String sex = request.getParameter("sex");
      String sszy = request.getParameter("master");
      String bbzy = request.getParameter("doctor");
      String sd = request.getParameter("masterTeacher");
      String nbbd = request.getParameter("doctorTeacher");
      String rxcj = request.getParameter("score");
      String cjpm = request.getParameter("cjpm");
      String beizhu = request.getParameter("beizhu");
      String male = "男";
      String female = "女";

      Sbld sbldstudent = (Sbld) BasicDAO.queryById(Sbld.class, id);
      sbldstudent.setId(id);
      sbldstudent.setName(name);
      sbldstudent.setXuehao(xuehao);
      if (sex.equals("male")) {
        sbldstudent.setSex(male);
      } else {
        sbldstudent.setSex(female);
      }
      sbldstudent.setSszy(sszy);
      sbldstudent.setBbzy(bbzy);
      sbldstudent.setSd(sd);
      sbldstudent.setNbbd(nbbd);
      sbldstudent.setRxcj(rxcj);
      sbldstudent.setCjpm(cjpm);
      sbldstudent.setBeizhu(beizhu);
      try {

        BasicDAO.update(sbldstudent);
        out.println(JavaScript.alertandRedirect("保存成功", "ApplicationInfo.jsp"));

      } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
        out.println(JavaScript.alertandBack("保存失败"));
      }

    } 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);
    }
  }
Beispiel #2
0
  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=GBK");
      pageContext = _jspxFactory.getPageContext(this, request, response, null, 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("\r\n");
      out.write("\r\n");

      String path = request.getContextPath();
      String basePath =
          request.getScheme()
              + "://"
              + request.getServerName()
              + ":"
              + request.getServerPort()
              + path
              + "/";

      out.write('\r');
      out.write('\n');

      String title = request.getParameter("title");
      String content = request.getParameter("content");
      String filename = request.getParameter("filename");
      String fileurl = request.getParameter("fileurl");

      Gcxknews gcxknews = new Gcxknews();
      gcxknews.setTitle(title);
      gcxknews.setContent(content);
      gcxknews.setPubtime(new Date());
      gcxknews.setFilename(filename);
      gcxknews.setFileurl(fileurl);

      try {

        BasicDAO.save(gcxknews);
        out.println(JavaScript.alertandRedirect("保存成功", "gcxknewslist.jsp"));

      } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
        out.println(JavaScript.alertandBack("保存失败"));
      }

      out.write("\r\n");
      out.write("\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);
    }
  }