A new programming idea (below): attached to NTGBDP2002

zhaozj2021-02-16  52

NTGBDP2002_DEFINE.JSP

-------------------------------------------------- -------------------

<% / * * GBDP2002, pay attention to cint.ntdb !!!, support INT * Note: This JSP is called by other pages, and extra spaces and carriage return cannot be generated. * /

File: // Global Variable Definition String GlobalTableName; String ParentKey = ""; String ParentValue = ""; String DBNAME = "MHOA"; NTDB NTP = New NTDB (); NTDB NT = New NTDB (); string SQL; String SQL_TRANS = ""; File: // Used to insert the SQL statement saved to the database so that in the middle of the transaction SQL_TRANS_ERROR = NTDB.SQL_TRANS_ERROR;

boolean isPost = false; {isPost = request.getMethod () equals ( "POST");.} boolean isEdit = false; boolean isAdd = false; boolean isDelete = false; boolean isUpload = false; boolean uploaded = false; file: / / Indicates that the Boolean TableCreated = false has been uploaded; file: // indicates that the database table has established {string contentTyPe = Request.getContentType (); if (ContentType! = Null && Contenttype.Indexof ("Multipart / Form-Data")! = -1) iSUPLOAD = true;} boolean hasid = false; boolean hasmasterid = false; int maxReturnRows = 10000; int ID = 0; // Indicates the main record ID number, generally 1, 2, 3 ..., You must be obtained in NTGBDPUPLOAD.JSP //, because when UPLOAD is unable to get parameters int maasterid = 0 from Request; // Same: // Absolute path string realpath; // Like 'C: / a /' {realPath = getServletConfig (). getServletContext (). getRealPath ("");} file: // Upload directory string uploaddir; {UPLOADDIR = RealPath "Upload";

File: // Store information of all requests, using it is that if there is UPLOAD, // Request will not re-find java.util.hashtable requestHt from UPLOAD; {RequestHt = New Java .util.hashtable (); enumeration E = request.getParameterNames (); while (E.hasMoreElements ()) {string s = (String) E.NEXTELEMENT (); string svalue = request.getParameter (s); requestht.put (s, sValue);}} file: // upload java.io.File mydir = null; SmartUpload mySmartUpload = null; if (isPost && isUpload) {mySmartUpload = new SmartUpload (); mySmartUpload.initialize (pageContext); // initialization mySmartUpload.upload (); // uploaded analysis request smartRes = mySmartUpload.getRequest (); {file: // request parameters into the global variable requestHt Enumeration e = smartRes.getParameterNames (); while (e.hasMoreElements ()) {String S = (String) E.NEXTELEMENT ()). Trim (); string svalue = (SmartRes.getParameter (s)). Trim (); RequestHt.Put (s, s, s, s, s, s, s, s, s, % ISedit = ispost && requestht.get ("e DIT ")! = null; isadd = ispost && requestht.get (" add ")! = null; isdelete = requestHt.get (" delete ")! = null; // This time when there is no command, all operation jumps Hasid = RequestHt.get ("ID")! = Null; id = 0; if (Requestht.get ("ID")! = Null) ID = integer.parseint ("ID") ); Hasmasterid = RequestHt.get ("masterid")! = Null; masterid = 0; if (Requestht.get ("masterid)! = Null) MasterId = INTEGER.PARSEINT (" masterid " ));

%>

转载请注明原文地址:https://www.9cbs.com/read-25578.html

New Post(0)