add_0005fkc_0002ejsp_jsp.java
资源名称:JSP02.rar [点击查看]
上传用户:top0756
上传日期:2022-08-11
资源大小:6501k
文件大小:6k
源码类别:
Jsp/Servlet
开发平台:
VBScript
- import java.sql.*;
- import proj112.*;
- import proj112.DataFormat;
- import javax.servlet.*;
- import javax.servlet.http.*;
- import javax.servlet.jsp.*;
- import org.apache.jasper.runtime.*;
- public class add_0005fkc_0002ejsp_jsp extends HttpJspBase {
- // begin [file="/add_kc.jsp";from=(4,0);to=(4,57)]
- // end
- static {
- }
- public add_0005fkc_0002ejsp_jsp( ) {
- }
- private static boolean _jspx_inited = false;
- public final void _jspx_init() throws org.apache.jasper.runtime.JspException {
- }
- 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;
- String _value = null;
- try {
- if (_jspx_inited == false) {
- synchronized (this) {
- if (_jspx_inited == false) {
- _jspx_init();
- _jspx_inited = true;
- }
- }
- }
- _jspxFactory = JspFactory.getDefaultFactory();
- response.setContentType("text/html; charset=gb2312");
- pageContext = _jspxFactory.getPageContext(this, request, response,
- "", true, 8192, true);
- application = pageContext.getServletContext();
- config = pageContext.getServletConfig();
- session = pageContext.getSession();
- out = pageContext.getOut();
- // HTML // begin [file="/add_kc.jsp";from=(0,49);to=(1,0)]
- out.write("rn");
- // end
- // HTML // begin [file="/add_kc.jsp";from=(1,31);to=(2,0)]
- out.write("rn");
- // end
- // HTML // begin [file="/add_kc.jsp";from=(2,30);to=(3,0)]
- out.write("rn");
- // end
- // HTML // begin [file="/add_kc.jsp";from=(3,39);to=(4,0)]
- out.write("rn");
- // end
- // begin [file="/add_kc.jsp";from=(4,0);to=(4,57)]
- proj112.dbconn a = null;
- boolean _jspx_speciala = false;
- synchronized (pageContext) {
- a= (proj112.dbconn)
- pageContext.getAttribute("a",PageContext.PAGE_SCOPE);
- if ( a == null ) {
- _jspx_speciala = true;
- try {
- a = (proj112.dbconn) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "proj112.dbconn");
- } catch (ClassNotFoundException exc) {
- throw new InstantiationException(exc.getMessage());
- } catch (Exception exc) {
- throw new ServletException (" Cannot create bean of class "+"proj112.dbconn", exc);
- }
- pageContext.setAttribute("a", a, PageContext.PAGE_SCOPE);
- }
- }
- if(_jspx_speciala == true) {
- // end
- // begin [file="/add_kc.jsp";from=(4,0);to=(4,57)]
- }
- // end
- // HTML // begin [file="/add_kc.jsp";from=(4,57);to=(11,0)]
- out.write("rnrnrn<html>rn<body>rnrnrn");
- // end
- // begin [file="/add_kc.jsp";from=(11,2);to=(20,2)]
- String kch = DataFormat.convert(request.getParameter("kch"));
- String kcm = DataFormat.convert(request.getParameter("kcm"));
- String rkjs = DataFormat.convert(request.getParameter("rkjs"));
- String xqj = DataFormat.convert(request.getParameter("xqj"));
- //int age = Integer.parseInt(request.getParameter("age"));
- String sj = DataFormat.convert(request.getParameter("sj"));
- String skjs = DataFormat.convert(request.getParameter("skjs"));
- // end
- // HTML // begin [file="/add_kc.jsp";from=(20,4);to=(21,2)]
- out.write("rn ");
- // end
- // begin [file="/add_kc.jsp";from=(21,4);to=(32,2)]
- /*
- out.print(num);
- out.print(name);
- out.print(pwd);
- out.print(addr);
- out.print(age);
- out.print(br);*/
- int result = a.executeUpdate("insert into kecheng(kch,kcm,rkjs,xqj,sj,skjs) values('"+kch+"','"+kcm+"', '"+rkjs+"', '"+xqj+"', '"+sj+"', '"+skjs+"' )");
- //int result = add.executeUpdate("insert into std(num,UserName,PassWord,addr,age,bedroom) values('222', '4', '546', 'asdf', 5, 'r')");
- // end
- // HTML // begin [file="/add_kc.jsp";from=(32,4);to=(34,0)]
- out.write("rnrn");
- // end
- // begin [file="/add_kc.jsp";from=(34,2);to=(36,2)]
- response.sendRedirect("list_kecheng.jsp");
- //out.print("插入成功!");
- // end
- // HTML // begin [file="/add_kc.jsp";from=(36,4);to=(40,0)]
- out.write("rnrn </body>rn </html>rn");
- // end
- } catch (Throwable t) {
- if (out != null && out.getBufferSize() != 0)
- out.clearBuffer();
- if (pageContext != null) pageContext.handlePageException(t);
- } finally {
- if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
- }
- }
- }