When developing Web applications, it is often necessary to apply both client-side and server-side technologies. Among them, the client application technology is mainly used to display information content, and the server application technology is mainly used for business logic processing and interaction with the database.

Web application technology application mode

  • The client
  • The server side

A case in field

1) Technology applied by the client

In the development of Web applications, the support of client technology is indispensable. At present, the more commonly used client technologies include HTML language, CSS, Flash and client scripting technology.

✓ HTML is the basis of the client technology, it is used to display the information of the web page, interpreted by the browser, it does not need to be compiled.

CSS is a technology called style sheets, also known as cascading style sheets. CSS styles are only useful when creating web pages, which can effectively achieve more precise control over page layout, fonts, colors, backgrounds and other effects.

✓ Flash is an interactive vector animation technology, which can include animation, audio, video and application programs. Flash files are small and suitable for Web applications.

✓ Client-side scripting refers to the code embedded in the Web page, which is interpreted by the browser. Through the scripting language, the page elements can be controlled programmatically, thus increasing the flexibility of the page. Common client-side scripting languages are JavaScript and VBScript. Currently, the most widely used client-side scripting language is JavaScript scripting, which is an important part of Ajax.

2) Server-side application technology

In the development of dynamic website, can not leave the server-side technology, the traditional and classic Web server-side technology mainly includes: CGI, ASP, SERVLET/JSP, PHP and so on.

CGI can be regarded as the earliest WEB server technology, it is HTTP filter program, its rough principle is: CGI is a program running on the WEB server, the program defines a method of WEB client request and response. As long as the client requests to the server (mainly HTML forms) fall within the scope of THE CGI definition, the CGI program will be started. Its task is to take out and convert the client requests from the environment variables of the network management and submit them to the CGI application programs on the server. These programs can be written in C/C++/PERL and other languages. These programs have the ability to access server resources (such as databases), and the results of these programs are sent to the client in HTML format through CGI. CGI program is easy to achieve access to the server resources, but output to the client is more troublesome, programmers can not use “what you see is what you get” web page making tools, only a line of handwritten HTML code, output to the client, not suitable for generating complex pages, this technology is now used by few people. However, the basic principles of CGI have been used by subsequent server-side web technologies.

✓ ASP ASP, a technology developed by Microsoft, appeared around 1997. It takes care of the CGI output headaches. ASP allows for a mix of HTML and server-side scripting. You can insert enclosed code snippets in HTML, which can be written in scripting languages such as JavaScript\VBScript, but which are executed on the server. ASP programming is very convenient, you can first use “what you see is what you get” web page making tools to make the page effect, and then insert server-side script output server-side results. Its disadvantages are: mixed programming of HTML and script makes the program very unreadable, which is not conducive to maintaining large WEB projects, and debugging of the script program is also a problem. ASP.NET, which disappeared around 2003, largely solved these problems. ASP also built several objects, these objects do not need to instantiate can be used, to achieve the state maintenance of web pages, HTTP simulation and other functions, these objects later mostly appear in JSP.

✓ PHP has the same syntax as C, with Perl, C++ and Java features. It is an open source Web server scripting language that, like ASP, can add script code to pages to generate dynamic content. For some complex operations can be encapsulated in a function or class. Many functions have been defined in PHP, such as the standard database interface, database connection, scalability. PHP is supported by many platforms but is widely used on UNIX/Linux platforms. Because PHP’s own code is open to the outside world and has been tested by many software engineers, the technology has so far been considered secure.

✓ JSP Java Server Page, short for JSP. JSP is based on Java development, so it uses Java powerful API functions. The HTML code in the JSP page is used to display the static content portion, and the Java code embedded in the page and JSP tags are used to generate the dynamic content. JSP allows programmers to write their own tag libraries to fulfill the specific requirements of an application. JSP can be precompiled to improve the speed of the program. In addition, the APPLICATION developed by JSP can be run anytime, anywhere after being compiled once. So on most system platforms, the code can run without modification on any server that supports JSP.

Servlet is Java’s early Web server technology, written in Java language. Both in principle and programming mode, it is almost a copy of CGI, with the shortcomings and advantages of CGI. The main difference with CGI is that Servlet starts a thread separately for each request, rather than a process.

extension

How Web applications work

Web applications can be broadly divided into two types, static and dynamic. Early Web applications focused on static page browsing, or static websites. These websites are written in HTML language and put on the Web server. Users use a browser to request Web pages on the server through HTTP. The Web server processes the received user requests and then sends them to the client browser for display.

With the development of the network, many offline businesses begin to develop online, and Internet-based Web applications become more and more complex. The resources accessed by users are no longer limited to static Web pages stored on the server. More content needs to dynamically generate page information according to the user’s request, that is, dynamic websites. These websites usually use HTML language and dynamic scripting language (such as JSP, ASP or PHP, etc.) to write, and the program is deployed on the Web server, the Web server processes the dynamic script code, and converts it into HTML code that the browser can parse, and returns it to the client browser. Display to the user.

For example, static websites are similar to mobile phones of 10 years ago, which can only use the factory-set functions and ringtones, and users can’t add or delete ringtones. The dynamic web is similar to the mobile phones that are now being developed. Instead of using the default ringtone, users can set it according to their preferences.