Currently, ASP (Active Server Pages), JSP (Java Server Pages ),
PHP (Hypertext Preprocessor ).
Introduction
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 adopts the script language VB script (Java Script
As your development language.
PHP is a cross-platform server-side embedded scripting language. It borrow a lot of C, Java, and Perl syntax.
Coupled with PHP's own features, Web developers can quickly write dynamically generated pages.
Database. One more thing, PHP is completely free and you don't have to spend any money, you can go to the official site of PHP ([url] http://www.php.ne [/url]
T) free download. 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 has been compiled and run with Zend support). Sun uses its own Jav
The extraordinary accomplishments of A, Java from the Java application and Java Applet, and new fruits, that is, JS
P -- Java Server Page. JSP supports powerful sites with the support of serverlet and JavaBean
Program.
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, the JSP code is compiled into a Servlet and interpreted and executed by the Java Virtual Machine.
The first request occurred. In ASP, PHP, and JSP environments, HTML code mainly describes the display style of information.
The program code is used to describe the processing logic. Common HTML pages only depend on Web servers, while ASP and pH
P. The JSP page requires additional language engines to analyze and execute program code. The execution result of the program code is re-embedded
HTML code, and then send it to the browser. ASP, PHP, and JSP are all web server-oriented technologies.
The client browser does not need any additional software support.
Technical Features
ASP:
1. Using VBScript, JScript, and other easy-to-understand scripting languages, combined with HTML code, you can quickly complete
The application of the website.
2. It is easy to compile without compile compilation and can be directly executed on the server side.
3. Use a common text editor, such as a Windows notepad, to edit the design.
4. browser independence
You can browse the webpage content designed by Active Server Pages. Script used by Active Server Pages
VBScript and JScript are executed on the Web server.
Script Language.
5. Active Server Pages can be compatible with any ActiveX Scripting Language. Besides VBScript
In addition to the JScript Language design, the plug-in method is also used to use other scripting languages provided by third parties.
Such as Rexx, Perl, and TCL. The script engine processes the COM (Component Object mod) of the script program.
El) object.
6. Use the server script to generate the client script.
7. ActiveX Server Components (ActiveX Server Component) is infinitely scalable. You can use vi
Sual basic, Java, Visual C ++, COBOL, and other programming languages to compile your required ActiveX se
Rver component.
PHP:
1. Database Connection
PHP can be compiled into functions connected to many databases. PHP and MySQL are a perfect combination. You can
You can write peripheral functions to indirectly access the database. In this way, when you change the database you are using, you can
You can easily change the encoding to adapt to this change. Phplib is the most commonly used base database to provide general transactions.
. However, the database interfaces provided by PHP are inconsistent with each other, such as Oracle, MySQL, and Sybase interfaces.
They are all different. This is also a weakness of PHP.
2. Object-Oriented Programming
PHP provides classes and objects. Web-based programming requires Object-Oriented Programming capabilities. PHP supports constructors,
Extraction class.
JSP:
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. Enable
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.
And all the scripts are running on the server. If the core logic is encapsulated in
In beans, other people, such as Web administrators and page designers, can edit and use JSP pages without affecting
Capacity generation.
On the server side, the JSP Engine interprets JSP identifiers and small scripts to generate the requested content (for example, by accessing Java
Beans component, use the jdbctm technology to access the database, or contain files), and use HTML (or XML) as the result)
Page form is sent back to the browser. This helps the author to protect his own code while ensuring any HTML-based Web browsing.
The full availability of the server.
2. Emphasize reusable components
Most JSP pages depend on reusable, cross-platform components (JavaBeans or enterprise javabea
Nstm component) to execute the more complex processing required by the application. Developers can share and exchange common operations
Or make these components used by more users or customer groups. The component-based method accelerates
The overall development process balances the development efforts of various organizations in 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. These functions are required for dynamic content generation in the easy-to-use and JSP-related XML identifiers. Standard JS
The P mark can be used to access and instantiate the JavaBeans component, set or retrieve component attributes, download the applet, and run
Other methods are more difficult to encode and consume.
Through the development of a custom identification library, JSP technology can be expanded. In the future, third-party developers and other personnel may
Create your own identification library for common features. This allows web page developers to use familiar tools and identity-like
The component that executes specific functions.
JSP technology can easily be integrated into a variety of application architectures to take advantage of existing tools and techniques and extend
Supports enterprise distributed applications. As part of the Java technology family, and 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
Java Servlet and 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 vendors can add JSP support to their products. You can use the server and tool of your choice.
Changing tools or servers does not affect the current application.
Application Scope
ASP is a dynamic web page language developed by Microsoft and inherits the consistent tradition of Microsoft products-it can only run on Microsoft
IIS (Internet Information Server) (Windows NT) and PWS (Personal Web SE)
Rver) (Windows 98. There are also chilisoft plug-ins in UNIX to support ASP, but ASP has limited functions,
It must be expanded through the combination of ASP + COM. It is very difficult to implement COM in UNIX.
Php3 can run properly on Windows, UNIX, and Linux Web servers. It also supports common Web servers such as IIS and Apache.
You do not need to change the php3 code when changing the platform.
JSP is similar to php3 and can run on almost all platforms. For example, in Windows NT, Linux, or Unix. nt, IIS
Such as JRun or ServletExec, JSP is supported. 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 current NT operation
The system occupies a large market share, but the Unix advantage in the server aspect is still great, and the new Linux
The trend is not small. Porting from one platform to another, JSP and JavaBean do not even need to be re-compiled, Because Java Byte
All codes are standard and platform-independent.
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
PHP tests 2000*2000 cycles (one order of magnitude less), but uses 63 s and 84 s respectively. (Refer to phplib)
.
In the database test, the three performed 1000 insert, update, select, and delete operations on Oracle 8, respectively.
: JSP takes 13 seconds, PHP takes 69 seconds, and ASP takes 73 seconds.
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 a popular technology, especially for e-commerce websites. jsp is mostly used.
Websites using PHP, such as Sina (SINA) and chinaren, have some shortcomings due to PhP.
Point, making it not suitable for large-scale e-commerce sites, but 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
Count: distribution calculation. 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. Another point mentioned above is the database interface support provided by PHP.
This makes it unsuitable for use in e-commerce.
ASP and JSP have no such defects. asp can obtain ActiveX rules through Microsoft windowsd COM/DCOM
DCOM and transcation server are used to obtain structure support. jsp can use Java clas of Sun Java
S and ejbs get support in scale, and get structure support through ejbs/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 J
SP/servlet. Well-known e-business of IBM, whose core is WebSphere with JSP/servlet;
Another famous Western e-commerce software provider, intershop. Its original products intershop1 2, 3
, 4 occupies the main share of e-commerce software. They are all supported through CGI. But after last October, it launched
Enfinity, an e-commerce application server using JSP/servlet, and the traditional voice is no longer developed