XML and JSP to join hands (1)

zhaozj2021-02-16  122

Overview: XML and JSP are the hottest things in these days. This article describes how to jointly build a dynamic website. You can also look at the sample code of DOM, XPath, XSL, and other Java-XML technology. We have assumed that you have learned JavaServer Pages (JSP) and Extensible Markup Language (XML). But maybe you are still confused about how to integrate them. JSP applications are easy, you can use it to design a web page, which looks like HTML. The only difference is that JSP is dynamically executed. For example, they can handle forms form and read and write databases. The description of the application of XML is more difficult. It seems that all products support it, everyone is also like the use of a variety of different purposes. In this article, you can see how to use XML in a fairly advanced way to design a system. Many sites have huge amounts of data to collect them in a very standard or unborn manner. I will design a system that stores on a web server using an XML file and displays data with JSP. XML VS Relational Database ", etc.!" You may ask, "Do you store data with XML file? Why don't you use a database?" This question asked very well. My answer is that the use of many purposes is too wasteful. To use a database, you must install and support a Separate Server Process, which often requires an Administrator installed and supported. You must learn SQL and write queries with SQL, then convert data, and return. And if you store data with XML file, you will reduce the load of additional servers. Also, you have also found a simple way to edit data. You only need to use a text editor without having to use a complex database tool. The XML file is easy to back up, shared with friends, or download it to your client. Similarly, you can easily upload new data to your site via FTP. XML has a more abstract advantage that as a layer-based format is better than the relationship. It can design data structures in a very direct way to meet your needs. You don't need to use an entity-relational editor, and you don't need to standardize your chart (Schema). If you have an element (Element) contains another element, you can represent it directly in the format without using the association of the table. Note that in many applications, it is not sufficient to rely on the file system. If there are many updates, the file system is destroyed by simultaneous writing. The database usually supports transaction processing, which can cope with the requested requests and not damaged. For complex query statistics, there must be repeated, timely updates, and this time the database performance is excellent. Of course, there are many advantages in relational databases, including rich query languages, chart tools, scalability, access control, and more. (Note: You can use simple file locks to provide a transaction server, you can also perform an XML index-and-search tool in Java, but this is already the topic of another article.) In the following In cases, as most small, based on the site-based site, most data access you may involve is read, not written, the data may be large, but it is relatively frequently updated. Change, you don't need to do a very complicated query, even if you need to do it, you will use a separate query tool, then the mature RDBMS has disappeared, and the advantages of object-oriented data model can be reflected. Finally, it is entirely possible to provide a querier shell for your database to perform SQL query and convert them into XML Stream is also entirely possible.

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

New Post(0)