V. ServerSideIncludes
ASP and JSP have similarities on server reference. Both ASP and JSP support virtual files on servers (IIS and APACHE) that support this function. However, JSP includes the results of dynamic pages, rather than the code containing the file. It is a very effective function to include files on another server without any code or objects.
ASP:
JSP: <! -- # Include file = "subfile. asp" -->
6. JAVA components: JavaBeans
JavaBeans is the encapsulated object data for completing predefined functions. Compared with COM and ASP, JavaBeans and JSP joins are as follows:
COM objects are often used to encapsulate business logic and complete High-Strength Computing for ASP pages. Reusable components make the page simple and fast, because the component consists of a compilation language (C ++, VB), rather than an interpreted scripting language (VBScript, JScript ).
JavaBeans can only be developed in java, and com can be developed in any language that complies with the standard Object Model (including Visual J ++ ). On the other hand, JavaBeans are easier to develop, because once you have mastered java, it is very easy to understand the structure of JavaBeans. Due to the complexity of com, it takes a lot of learning and training to master-even if you have c ++ and vb basics, you need additional efforts. The Com component must be registered on the server. If you modify an existing component, the server must be restarted to use it. JavaBeans do not need to be re-registered. If developers do not need to obtain full access permissions to the server, this is a huge advantage.
You can create a complete JavaBeans library that meets the business logic, so that non-programmers can use the library to develop dynamic websites.
Beans can manage database connections on the server.
JavaBeans conforms to the structured object model: Each Bean is composed of a constructor without parameters. The servlet that controls it can use introspection to set its attributes. To set the built-in attributes of Bean, you must use the setProperty tag with the attribute name. If a property can be set, the Bean must have a setXxxx method, and Xxxx should be replaced by the actual property name.
VII. JSP and database
ASP uses ODBC to connect to the database through ADO, while JAVA connects to the database through a technology called JDBC. The target database requires a JDBC driver-a database and JAVA interface, so that JAVA can access the database in a standard way. JDBC does not use server-side data sources. JAVA can access the database as long as there is a JDBC driver. If a particular database has no JDBC driver and only ODBC drivers, JAVA provides a JDBC-ODBC bridge to convert JDBC calls into ODBC calls. All JAVA compilers have a free JDBC-ODBC bridge. Theoretically, the bridge can access any common database products.
Conclusion: The JSP model is defined after ASP. It uses many advantages of ASP, such as Session and Application objects. At the same time, JSP uses a flexible and powerful JAVA language, rather than an inefficient Scripting language. ASP developers can only use windows-based technologies, while java and jsp are cross-platform.