Understanding of Web Containers
The concept of Web containers is well elaborated in the Java Web Development Practice Classic-basic article, which uses its perspective to understand the Web container:
To run a Java Web program, you must have the appropriate Web container support, because all of the dynamic page's program code is executed in the Web container, and the resulting results are delivered to the user.
The server side uses the Web service plug-in to accept the client's HTTP request and judge the user's request to determine whether it is a dynamic request or a static request. In the case of a static request, the file is obtained directly from the file system via the Web server and returned to the client browser via the HTTP protocol, and if it is a dynamic request, all content is submitted to the Web container, and the displayed results are generated dynamically by the program in this container. Finally, it is also returned through the Web server.
Installation and configuration of Tomcat
1, Tomcat installation needs to configure a java_home environment variable : "My Computer" → "Properties" → "Advanced" → "Environment variable" → "New user variable", "Variable name" is Java_home, "variable value" is the JDK installation folder (for example: "D:\ Java\jdk1.6.0_02 ").
2, Modify the port number , Conf/server.xml file, find the following content:
<connector port= "8080" protocol= "http/1.1" connectiontimeout= "20000" redirectport= "8443"/>
Modify the Port property value to the desired port number, as modified to a 80 port number:
<connector port= "protocol=" http/1.1 "connectiontimeout=" 20000 "redirectport=" 8443 "/>
3, Configure the virtual directory , found in the Conf/server.xml file, such as location, in the figure 142 lines add the following code:
<context path= "/mldn" docbase= "D:\mldnwebdemo"/>
Path: Represents the access virtual path name on the browser, which must be preceded by "/".
DocBase: Represents the real path address represented by this virtual path name.
1, the understanding of the Web container &tomcat installation and configuration