Comparison between JSP features and other dynamic web page development technologies

Source: Internet
Author: User

JSP technical features:

1. Separate content generation and display

With JSP technology, Web page developers can use HTML or XML tags to design and format the final page. Use JSP identifiers or small scripts to generate dynamic content on the page. The logic of the generated content is encapsulated in the identifiers and JavaBeans components and bundled in small scripts. All scripts run on the server. If the core logic is encapsulated in identifiers and Beans, other people, such as Web administrators and page designers, can edit and use JSP pages without affecting content generation.

On the server side, the JSP Engine interprets JSP identifiers and small scripts to generate the requested content, for example, accessing the JavaBeans component, using the JDBCTM technology to access the database, or including files ), and the results are sent back to the browser in the form of HTML or XML) pages. This helps the author protect his own code and ensure the full availability of any HTML-based Web browser.

2. Emphasize reusable components

The vast majority of JSP pages depend on reusable, cross-platform components JavaBeans or Enterprise JavaBeansTM components) to execute more complex processing required by applications. Developers can share and exchange components that perform common operations, or make these components used by more users or customer groups. The Component-Based Approach accelerates the overall development process and balances various organizations in their development efforts with their existing skills and optimization results.

3. Simplified page development with logo

Web page developers are not all programmers familiar with the scripting language. The assumerver Page technology encapsulates many functions that are required for dynamic content generation in easy-to-use and JSP-related XML identifiers.

The standard JSP mark can access and instantiate the JavaBeans component, set or retrieve component attributes, download the Applet, and execute functions that are more difficult to encode and consume in other ways. Through the development of a custom identification library, JSP technology can be expanded. In the future, third-party developers and others can create their own identification libraries for common functions. This allows Web page developers to work with familiar tools and components that execute specific functions like identifiers.

JSP technology can easily be integrated into a variety of application architectures to take advantage of existing tools and techniques and extend to support enterprise-level distributed applications. As part of the Java technology family and the Java 2 Enterprise Edition architecture), JSP technology can support highly complex Web-based applications.

Because the built-in scripting language of JSP pages is based on the Java programming language, and all JSP pages are compiled into Java Servlets, JSP pages have all the advantages of Java technology, including robust storage management and security.

As part of the Java platform, JSP features the Java programming language "one-time writing, running everywhere. As more and more vendors add JSP support to their products, you can use the servers and tools you select. Changing tools or servers does not affect the current application.

Comparison with other dynamic web technologies:
Compared with traditional CGI methods
A. The background implementation logic is based on Java Component and features cross-platform
B. Separating application logic from page performance enables application logic to be reused to the maximum extent, thus improving development efficiency
C. The running mode is higher than the CGI Mode. Especially for database access, the connection pool buffer mechanism is provided to minimize the resources required for running.
D. Security. Because the backend is completely based on Java technology, the security is guaranteed by the Java security mechanism.
E. Because it is very similar to ASP, you can write JSP without too much programming knowledge.
F. The built-in support for XML makes the page more expressive and reduces programming workload.

Comparison with Asp and php:

Currently, the three most common dynamic web page languages are ASP (Active Server Pages), JSP (Java Server Pges), and PHP (Hypertext Preprocessor ).

ASP full name Active Server Pages is a WEB Server development environment that can be used to generate and run dynamic, interactive, and high-performance WEB service applications. ASP uses the scripting language VB ScriptJava script) as its own development language.

PHP is a cross-platform server-side embedded scripting language. it borrowed a lot of C, Java, and Perl syntaxes and coupled with PHP's own features, enabling WEB developers to quickly write dynamic pages. it supports most databases currently. Another point is that PHP is completely free and free to spend, and you can download it freely from the official site of PHP (http://www.php.net. In addition, you can obtain the source code without restrictions, and even add the features you need.

JSP is a new generation of site development language released by Sun. It completely solves a common problem of ASP and PHP-script-level execution. It is said that PHP4 is also supported by Zend, compile and run the program ). with its extraordinary accomplishments in Java, Sun has made a new achievement in Java applications and Java applets, namely Jsp-Java Server Page. Jsp supports powerful site programs with the support of Serverlet and JavaBean.

All three provide the ability to mix some program code in HTML code and explain and execute the program code by the Language engine. However, JSP code is compiled into a Servlet and interpreted and executed by the Java Virtual Machine. This compilation operation only occurs during the first request to the JSP page. In ASP, PHP, and JSP environments, HTML code describes the display style of information, while program code describes the processing logic. Common HTML pages only depend on Web servers, while ASP, PHP, and JSP pages require additional language engines to analyze and execute program code. The execution result of the program code is re-embedded into the HTML code and sent to the browser together. ASP, PHP, and JSP are all Web server-oriented technologies. Client browsers do not require any additional software support.

JSP vs ASP

JSP is cross-platform and supports more than 85% of all mainstream Web servers, including Apache, Netscape, IIS, and IBM Http Server ), ASP currently only supports NT + IIS (with a market share of about 20%). It provides a better security mechanism, which is crucial for applications such as e-business; JSP can be used across operating systems, Web servers, and application servers, whereas ASP is limited to NT + IIS;

JSP is an open standard and is supported by Oracle, Netscape, IBM & WebLogic, and Inprise. JSP components are easier to write, and JSP performance is caused by ASP;

JSP vs PHP

JSP is an industry standard and supported by Sun, IBM, Oracle, BEA, Apache, etc. PHP is only a free ware with a poor development organization. PHP has poor performance, it is interpreted. JSP is equivalent to c after JIT compilation and supports multithreading. JSP supports many platforms, from Win98, NT, Unix, Linux, FreeBSD to AS/400, OS/390, while PHP supports a limited platform; JSP can connect to many mainstream relational databases using JDBC, while PHP currently only supports a limited number of MySql and Oracle; JSP components, it is very easy to develop JavaBean and EJB, and all Java classes and functions can be used in JSP. PHP can only use C to write components with limited functions, and the compilation is complicated. JSP can support EJB to support Transaction and CORBA standards, and LDAP, Message, and other services, this makes it easy to access enterprise applications such as ERP, CICS, and MQ. PHP is inherently inadequate in this respect, so PHP is not suitable for Mission-critical applications such as e-commerce.

Performance Comparison

Some people have performed tests to test the cyclic performance of these three languages and to access the Oracle database. In the cyclic performance test, JSP ended the 20000*20000 loop in just four surprising seconds. ASP and PHP test 2000*2000 cycles by an order of magnitude), but they use 63 s and 84 s respectively.

In the database test, it takes 13 seconds for Oracle 8 to perform 1000 Insert, Update, Select, and Delete: Jsp, 69 seconds for Php, and 73 seconds for ASP.

Foreground Analysis

PHP and ASP are widely used in China. JSP is a relatively new technology, which is rarely used in China. However, in foreign countries, JSP is already a popular technology, especially for e-commerce websites, mostly using JSP.

Websites using PHP, such as xinlang net sina and Chinaren, are not suitable for large-scale e-commerce sites due to some shortcomings of PHP, it is more suitable for some small commercial sites.

First, PHP lacks support for scale. Second, the lack of multi-layer structure support. For heavy-load sites, there is only one solution: distributed computing. The database and application logic layers are separated from each other, and the same layer can also be separated by traffic to form a two-dimensional array. PHP lacks such support. As mentioned above, the database interfaces supported by PHP are not uniform, which makes it unsuitable for e-commerce.

ASP and JSP have no such defects. ASP can obtain ActiveX scale support through Microsoft Windowsd COM/DCOM, and obtain structure support through DCOM and Transcation Server; JSP can be scaled through SUN Java's Java Class and EJB, and structural support can be obtained through EJB/CORBA and Application Server of many vendors.

Among the three, JSP should be the future development trend. Some of the world's leading e-commerce solution providers use Servlet and JSP. Ibm e-business is famous for its core: Servlet and JSP WebSphere. Another famous Western E-commerce software provider, Intershop. Its original products Intershop1 2, 3, and 4 occupy the main share of e-commerce software. They are all supported through CGI. However, after last October, it launched Enfinity, an e-commerce Application Server that uses Servlet and JSP, and does not develop traditional software.

JSP application scope:

Like PHP, JSP can run on almost all platforms. For example, in Windows NT, Linux, and Unix. NT, IIS supports JSP through a plug-in, such as JRUN or ServletExec. The famous Web server Apache already supports JSP. Because Apache is widely used in NT, Unix, and Linux, JSP has a wider operating platform. Although the NT operating system has a large market share, the Unix advantage in the server is still great, and the new Linux is not small. Porting from one platform to another, JSP and JavaBean do not even need to be re-compiled, Because Java bytecode is standard and platform-independent.

  1. Session-based online user statistical analysis in JSP
  2. Experience in Servlet and JSP Performance Optimization
  3. JSP tag library Parsing
  4. Import event-driven technology in JSP Servlet Development
  5. Six common issues for JSP Programming

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.