Tomcat
One 、JavaWeb The concept of
1、 What is? JavaWeb
2、 What is a request
Request means that the client sends data to the server , Call for a request Request.
3、 What is response
4、 The relationship between request and response
Two 、Web Classification of resources
3、 ... and 、 frequently-used Web The server
Four 、Tomcat The server and Servlet Version correspondence
5、 ... and 、Tomcat Use
1、 install
2、 catalogue
3、 How to start Tomcat The server
The second way :
① Open the command line ;
② Switch to Tomcat Of bin Under the table of contents ;
③ Enter the start command :catalina run
4、 How to test Tomcat Successful launch ?
①http://localhost:8080
②http://127.0.0.1:8080
③http:// real ip:8080
The following interface appears , Indicating successful startup .
Be careful : If it starts , The command line black window flashed past , Description no configuration JAVA_HOME environment variable , Configure as required JAVA_HOME that will do .
5、Tomcat The stop of
① Click on the ×
② take Tomcat The window of is placed in the current window ,CTRL+C stop it
③ find Tomcat Of bin In the catalog shutdown.bat, Double click to stop Tomcat The server .
6、 How to modify Tomcat Port number
find Connector label , modify port Property value is enough .
7、 How to feel the heat web Project to Tomcat in
The first way :
① stay webapps Create one in the directory book engineering :
② take book Copy the project resources to book Under the table of contents :
③ How to access the Tomcat Under the web engineering :
Browser address bar input :http://ip:port/ project name / Catalog / file name
The second way :
find Tomcat Under the conf Catalog \Catalina\localhost\ Next , Create the following configuration file :
book.xml The contents of the configuration file are as follows :
take book Copy the project to D:\book Next :
visit :http://localhost:8080/book/index.html, It means to visit D:\book\index.html Catalog .
8、ROOT A visit to the project , as well as Default index.html Page access
6、 ... and 、IDEA Integrate Tomcat The server
open idea Settings page of , The operation is as follows :

See if the configuration is successful :
7、 ... and 、IDEA middle voice web The operation of the project
1、IDEA How to create dynamic web engineering
Create a module :
Choose what type of module you want to create :
Enter your module name , Click on finish complete :
Successfully created the following figure :
2、Web Introduction to the project catalogue
3、 How to give dynamic web The project adds extra jar package
① stay WEB-INF Create one in the directory lib Catalog ( Used to store third parties jar package ):
② What will be needed jar Package copy to lib Under the table of contents :
③ Will these jar Package added to classpath :
Browse , choice lib All under directory jar package :
Add the classpath successfully, as shown in the figure below :
4、 How to be in IDEA Central government department works to Tomcat Up operation
modify web The project corresponds to Tomcat Operation example :
Confirm your Tomcat The instance contains the one that you want to deploy and run web Engineering module :
Modify the project path :
Other operations that need to be modified :