JSP newbie development notes (increasing)

xiaoxiao2021-03-06  74

1. When accessing the database bean by connecting the pool, the connection should be turned off, otherwise the browser will stop responding when the configuration value of the Maxactive in the connection pool is reached - the paging program that re-queries per page will usually encounter this problem. 2. When developing the Bean to access the database, the method does not return ResultSet to change to ArrayList or HashMap. Because after the connection is closed, ResultSet does not exist. 3. In the JSP Servlet Bean development mode, the return value is saved in the servlet, and the return value is obtained in the JSP page in the jsp page. Tomcat4.1.30 graphics management interface configuration The data source is a global resource, which is not written directly: context initctx = new initialContext (); context ctx = (context) ITCTX.LOOKUP ("Java: comp / ENV"); // Get the connection pool object Object obj = (object) CTX.lookup ("JDBC / ORACLEDB"); // Type conversion javax.sql.datasource DS = (javax.sql.datasource) Obj; connection conn = ds.getConnection If you modify server.xml with Notepad, the location of the data source is configured correctly ( ), the above code is 5 that can be performed correctly. Struts configuration file understanding: 1) Struts-config.xml is stored under Web-INF and its subfolders: For example, there are TEST1, TEST2 two sub-applications, then Web-INF should have TEST1, TEST2 folders, Among them, there are also respects Struts-config.xml2) defined forMBean names used as Name properties, the corresponding FORMBEAN is a description of the form that uses this action, its property name is similar to the JSP form element name Uniform 6. JAR Package Method: 1) The command line executes web-inf / class> jar -cvf myclasses.jar.; 2) Copy myclasses.jar to WEB-INF / LIB below (all JARs under the JSP runtime) File lookup class); 3) JAR is the same as the RAR's format, just a META-INF folder (which is a Menifest.mf file).

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

New Post(0)