Home  >  Article  >  Backend Development  >  Detailed introduction to introductory knowledge of XML and Tomcat

Detailed introduction to introductory knowledge of XML and Tomcat

黄舟
黄舟Original
2017-03-18 17:20:301404browse

Introduction to

ML1, XML: eXtensible Markup Language, extensible markup language.

2. Application: Commonly used in three places

(1) Used as a format for transmitting data between systems

(2) Used to express relationships in life The data

(3) is often used in the system’s configuration file

3, syntax structure

(1) There must be a document declaration in XML, The position must be in the first row and first column

(2) Most XML tags are similar to HTML, but XML has only one tag and is case-sensitive

XML also has a CDATA area Writing method Treat the content in the CDATA area as ordinary text content instead of tags.

4. Parsing method

(1)dom parsing Allocate a tree structure in the memory according to the hierarchical structure of xml, and then parse it according to the tree structure. Advantages: The tree structure facilitates the operation of adding, modifying and deleting.

Disadvantages: If the file to be parsed is too large, a tree structure will be allocated in the memory at one time, causing memory overflow.

(2) Sax analysis: parse while reading when using sax method When a specific tag is read, the corresponding method is automatically called for operation. Advantages: It will not cause memory overflow.

(3) The principle of pull parsing is that sax parsing imports two jar packages, creates a parser by creating a parser factory, and puts the files that need to be parsed into the parser to form a tool class effect. It can also be used as a collection (

Object

) The data inside is written to the xml file (serialization)Tomcat

1. Introduction to Tomcat: It is an open source free server organized by Apache.

2. WEB related content

(1) Dynamic resources: data changes;

Static

Resources: html+css+js. (2) cs: client server; bs: browser server.

(3) Communication between webs: Convert the entered domain name into an IP address, and access it through the IP address + port number

(4) Server Introduction

a Hardware: A computer with high configuration: Software: Install server software on the computer

b Common web server: tomcat server (open source and free );weblogic server;websphere server

3. Tomcat release project

(1)Open project deployment

a In the webapps directory in tomcat, copy the project directly to this Below the directory

b Static website: Create a folder in tomcat's webapps directory, and you can access this file in the address bar of the browser

For example: http://127.0.0.1: Port number/name of created folder/name of file

c Dynamic website: If you want to run a dynamic website in tomcat, you must follow a certain

directory structure

(2) Configure virtual path

a Find server.xml in tomcat's conf directory, configure the virtual path, and write it in the Host tag

b Find tomcat's conf, continue searching below \Catalina\localhost folder, create an xml format file in this folder, and configure the virtual path

(3) Use myeclipse to integrate tomcat

a Integrate tomcat in myeclipse Process

b Start tomcat server and shut down tomcat server in myeclipse

c Publish the project to tomcat in myeclipse

d Remove the project from tomcat in myeclipse

HTTP protocol

1. Introduction: The data format followed by requests and responses

2. Features: Operations based on requests and responses (request first, then response), Based on tcp protocol, port 80

3. Request and response

(1) Request: Enter an address in the address bar of the browser and click Enter. This process is a request

(2) Response: The server returns the data and displays it on the browser page according to the request sent. This process is called response

The above is the detailed content of Detailed introduction to introductory knowledge of XML and Tomcat. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn