ASP and JSP comparison (ii)

Source: Internet
Author: User
Tags object comparison contains include odbc object model access
Comparison of js| |js ASP and JSP (II.)

Five, Serversideincludes
ASP and JSP have the same place on the server side references. ASP and JSP can support this functionality on the server (Iis,apache) to implement server-side contains virtual files. But the JSP is to include the result of the dynamic page, not the code itself that contains the file. When you include files on another server, it is a very effective function to not include any code and objects.

Asp:
jsp:<% @includefile = "subfile.jsp"-->


VI. Java components: JavaBeans
JavaBeans is the encapsulated object data that completes the predefined functions. The JavaBeans and JSP engagement are compared to COM and asp:

COM objects are commonly used to encapsulate business logic and to perform high-intensity computations for ASP pages. Reusable components make the page simple and fast, because the component is composed of a compiled language (C++,VB) rather than an interpreted scripting language (VBScript, JScript).
JavaBeans can only be developed in the Java language, and COM may be developed by any language that conforms to the standard object model (including Visual J + +). On the other hand, JavaBeans is easier to develop, because once you've mastered Java, it's easy to understand the structure of JavaBeans. Because of the complexity of COM, you need a lot of learning and training to master-even if you have C + + and VB Foundation also need extra effort. Com components need to be registered on the server, and if you modify an existing component, the server needs to be restarted to use it. JavaBeans does not require a re-register, which is a great advantage if the developer does not need full access to the server.
You can create a complete JavaBeans library that satisfies business logic, allowing non-programmers to use libraries to develop dynamic Web sites.
Beans can manage database connections on the server side.
JavaBeans conforms to the Structured object model: Each bean consists of a constructor with no parameters, and the servlet that controls it can set its properties using introspection (introspection). To set the bean's built-in properties, you must use the SetProperty label with the property name. If a property can be set, the bean needs to have a setxxxx method, and XXXX replaces it with the actual property name.
Seven, JSP and database
ASP uses ODBC to connect to the database through ADO, while Java joins the database through a technology called JDBC. The target database requires a JDBC driver--a database and Java excuse that allows Java to access the database in a standard way. JDBC does not use server-side data sources. As long as there is a JDBC driver, Java can access the database. If a particular database does not have a JDBC driver, and only the ODBC driver, Java provides a JDBC-ODBC bridge to convert the JDBC call into an ODBC invocation. All of the Java compilers are equipped with a free JDBC-ODBC bridge. In theory, a bridge can access any common database product.

Conclusion: The JSP model is defined after the ASP, it borrows many advantages of ASP, such as Session,application and other objects. JSP also uses a flexible and powerful Java language, rather than an inefficient scripting language. ASP developers can only use windows-based technology, while Java and JSP are cross-platform.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.