Talk about the client's Java technology

zhaozj2021-02-16  68

What is the resource that is based on the server that must be stored on the server? This type of server-based resource includes address verification, transportation cost calculation, and credit card verification. Support data and processing of high security must be placed on the server, but most of the verification processing, data conversion, and cost calculation processes can be migrated to the client system. Several Java language features that support this idea include:

The Java language provides intrinsic support for HTTP connections over the HTTPurlConnection object. At the same time, the other parts of the Java.NET package uses communication between the server code and the client code to simply and effectively generate data or packaging data. Many client Java Applet codes are actually the same as those running on the server.

Now we can assign multiple tasks to the server and client, thereby reducing server loads, and may even reduce network connections. How to assign these tasks will depend on the type of the system and the user group, but almost all systems will benefit from adding some client processing, for example:

The Applet class can transform data from a series of formats to a single XML string format, which makes the server more easily handled data. The Applet class can compress data, that is, the data compression of those will be uploaded to the server, and divide these data into smaller packets, thereby further improving the reliability. When the user fills in the checkout form, the Applet class can calculate the address and transportation costs (in a larger server database, such calculations often need to interact). This method can reduce the time required for the final settlement, while allowing users to see the correct transportation fees and corresponding taxes before submitting orders.

In order to play the biggest advantage of this technology, it is necessary to send a request to the server that returns the specified data. Java servlets have this capability. Many developers are not fully aware of the servlet to respond to any of the data, not just HTML or XML. By returning a series of continuous objects or a compressed packet, the servlet can perform tasks such as address confirmation or transportation costs, and tax calculations. At the same time, the client code for these calculations can mask the user waiting time through the running of the background thread. A servlet is displayed in Listing 2, which receives the GET request with ZIP code and returns the calculation result of the transport fee. Also, a number of very important actual code is omitted here for the purpose of clearing the list.

Note I use the ObjectOutputStream object to write the entire target chart into the response to returned. The Content Type requires some suitable values ​​while assigning the Content handler to the client. This method can return a Java object, which contains customer transportation, processing costs, and calculation results of payable tax. If this object is only communicating with the client lattime thread, the user will not realize that he has already communicated with the server.

The above technique for saving time has been implemented for several times, and most of the world is applying in various systems. I have promised some new technologies in front of me, and now I'm specifically elaborate. The most interesting Java new technology on the client is a Weblet. IBM AlphaWorks DirectDom is a specific implementation of this technology (see the data part). DirectDom allows access to the entire browser DOM Tree from the Java code (November 13, 2000, the W3C is recommended for Dom Level 2). Weblet does not have a user interface, and you must complete its work by manipulating the activity DOM documentation in your browser. Many techniques that originally needed to be complex JavaScript code can be implemented by this method. It must be noted that although DirectDom is an attractive technology, it is still in the alpha phase, is imperfect, and the latest version of Internet Explorer or Mozilla (M18) is required to run. However, this technology is enough to make you predict how it will be exciting future. Some examples of possible implementations are as follows: Add Weblet on a settlement page full of graphics and visual stimuli. Then when the user handles the settlement table, it is not necessary to switch between the form and the webpage every step, and the data can be exchanged with the server and complete the settlement. When the settlement needs to be confirmed, the Weblet submits the entire package to the server, and the server can be processed in accordance with the usual settlement process. A web page that displays the property message. The Weblet tells the page blank to mark the response of printing or saving the request, thereby preventing data from being shared distinguishable. Users can request some reports to applications on the Internet. The summary information of the report will be delivered immediately, and Weblet uses the background thread to download the details of the report. When the user is interested in a summary of the strike, as long as the mouse click on this entry, the Weblet can immediately respond to the mouse action, and the details are displayed below this entry. These specific information is downloaded by the background thread after downloading of the summary page. But users will not notice this.

Another longer example, clearer display how Weblet works. In Listing 3, this example can be seen in the HTML page and a list of clients, and the Java code of the Weblet class. Although it is not suitable for the production environment, it is still useful. This example downloads a long demonstration page that contains two forms and a Weblet tag. Weblet uses some introductory text to replace these forms or switch these two forms during the demo.

Why do you do this? Why will we pay attention to the development of the client's Java technology? Why not build systems that work only on the network, or a thin customer system, and perform most of the complex calculations on the server? Simply put, it is because we cannot provide such a server service. If you want to install enough handlers in a single server space to support a large number of client requests, the overhead will be extremely expensive, so the distributed system model (N-Tier structure) is developed. The client's Java technology allows us to reduce the operation overhead in large systems, greatly improve the client's participation - reduce the number of rounds communication between users and servers, improve interaction level, improve data confirmation speed. The client's Java technology can also help us implement tasks that are difficult to complete separately, such as tagn-based digital signatures. Even a single development platform, the Enterprise Edition Java 2 also provides a powerful architecture. Client Java technology can be combined with servers who support Java 2 platforms, which will not be fully utilized. What will those resources that must be stored on the server? This type of server-based resource includes address verification, transportation cost calculation, and credit card verification. Support data and processing of high security must be placed on the server, but most of the verification processing, data conversion, and cost calculation processes can be migrated to the client system. Several Java language features that support this idea include: Java language provides intrinsic support for HTTP connections over the HTTPurlConnection object. At the same time, the other parts of the Java.NET package uses communication between the server code and the client code to simply and effectively generate data or packaging data. Many client Java Applet codes are actually the same as those running on the server.

Now we can assign multiple tasks to the server and client, thereby reducing server loads, and may even reduce network connections. How to assign these tasks will depend on the type of the system and the user group, but almost all systems will benefit from adding some client processing, for example:

The Applet class can transform data from a series of formats to a single XML string format, which makes the server more easily handled data. The Applet class can compress data, that is, the data compression of those will be uploaded to the server, and divide these data into smaller packets, thereby further improving the reliability. When the user fills in the checkout form, the Applet class can calculate the address and transportation costs (in a larger server database, such calculations often need to interact). This method can reduce the time required for the final settlement, while allowing users to see the correct transportation fees and corresponding taxes before submitting orders.

In order to play the biggest advantage of this technology, it is necessary to send a request to the server that returns the specified data. Java servlets have this capability. Many developers are not fully aware of the servlet to respond to any of the data, not just HTML or XML. By returning a series of continuous objects or a compressed packet, the servlet can perform tasks such as address confirmation or transportation costs, and tax calculations. At the same time, the client code for these calculations can mask the user waiting time through the running of the background thread. A servlet is displayed in Listing 2, which receives the GET request with ZIP code and returns the calculation result of the transport fee. Also, a number of very important actual code is omitted here for the purpose of clearing the list.

Note I use the ObjectOutputStream object to write the entire target chart into the response to returned. The Content Type requires some suitable values ​​while assigning the Content handler to the client. This method can return a Java object, which contains customer transportation, processing costs, and calculation results of payable tax. If this object is only communicating with the client lattime thread, the user will not realize that he has already communicated with the server. The above technique for saving time has been implemented for several times, and most of the world is applying in various systems. I have promised some new technologies in front of me, and now I'm specifically elaborate. The most interesting Java new technology on the client is a Weblet. IBM AlphaWorks DirectDom is a specific implementation of this technology (see the data part). DirectDom allows access to the entire browser DOM Tree from the Java code (November 13, 2000, the W3C is recommended for Dom Level 2). Weblet does not have a user interface, and you must complete its work by manipulating the activity DOM documentation in your browser. Many techniques that originally needed to be complex JavaScript code can be implemented by this method. It must be noted that although DirectDom is an attractive technology, it is still in the alpha phase, is imperfect, and the latest version of Internet Explorer or Mozilla (M18) is required to run. However, this technology is enough to make you predict how it will be exciting future. Some examples of possible implementations are as follows:

Add Weblet on a settlement web with a large number of graphics and visual stimulus. Then when the user handles the settlement table, it is not necessary to switch between the form and the webpage every step, and the data can be exchanged with the server and complete the settlement. When the settlement needs to be confirmed, the Weblet submits the entire package to the server, and the server can be processed in accordance with the usual settlement process. A web page that displays the property message. The Weblet tells the page blank to mark the response of printing or saving the request, thereby preventing data from being shared distinguishable. Users can request some reports to applications on the Internet. The summary information of the report will be delivered immediately, and Weblet uses the background thread to download the details of the report. When the user is interested in a summary of the strike, as long as the mouse click on this entry, the Weblet can immediately respond to the mouse action, and the details are displayed below this entry. These specific information is downloaded by the background thread after downloading of the summary page. But users will not notice this.

Another longer example, clearer display how Weblet works. In Listing 3, this example can be seen in the HTML page and a list of clients, and the Java code of the Weblet class. Although it is not suitable for the production environment, it is still useful. This example downloads a long demonstration page that contains two forms and a Weblet tag. Weblet uses some introductory text to replace these forms or switch these two forms during the demo.

转载请注明原文地址:https://www.9cbs.com/read-17138.html

New Post(0)