Combination of XML and JSP

Source: Internet
Author: User
Xml and jsp are the hottest things in these days. This article describes how to combine these two technologies to build dynamic websites. You can also take a look at the sample code of dom, xpath, xsl, and other java-xml technologies.
Let's assume that you already know about javaserver pages (jsp) and extensible markup language (xml ). However, you may still be confused about how to use them comprehensively.
Jsp applications are easy to use. You can use it to design webpages and make them look the same as html. The only difference is that jsp is dynamically executed. For example, they can process form forms and read/write databases.
It is difficult to describe the xml application. It seems that all products support it, and everyone seems to be using it for various purposes.
In this article, you can see how to design a system using xml in a fairly advanced way. Many sites collect massive amounts of data and display them in a very standard or unstandard manner. I will design a system that uses xml files for storage on the web server and jsp to display data.
Xml vs relational database
"Wait! "You may ask," Are you using an xml file to store data? Why not use the database? "
This is a good question. My answer is that it is too wasteful to use databases for many purposes .. To use a database, you must install and support a separate server processing process (a separate server process), which usually requires the administrator to install and support it. You must learn SQL, use SQL to write queries, convert data, and return data. If you use an xml file to store data, you can reduce the load on the server. Also, you have found a simple way to edit data. You only need to use a text editor instead of complex database tools. Xml files can be easily backed up, shared with friends, or downloaded to your client. Similarly, you can easily upload new data to your site through ftp.
Xml also has a more abstract advantage, that is, as a hierarchical format is better than relational.
It can be used directly to design the data structure to meet your needs. You do not need to use an entity-link editor or standardize your chart schema.
If one element contains another element, you can directly represent it in the format without using table Association.
Note: In many applications, relying on file systems is insufficient. If there are many updates, the file system will be damaged due to simultaneous writing. Databases usually support transaction processing and can cope with the requests that occur without being damaged. Complex query statistics must be updated repeatedly and in a timely manner, and the database performance is excellent at this time. Of course, relational databases also have many advantages, including rich query languages, graphic tabulation tools, scalability, and access control.
(Note: You can use simple file locking to provide a transaction processing server. You can also execute an xml index-and-search tool in java, but this is already the topic of another article .)
Related Article

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.