Steps to create a new JavaWeb project using IDEA

Create project

1.Select create new project, Create a new project
Insert picture description here
2. Select the project type asJava Enterprise, And configure JDK and other information
Insert picture description here
3.勾选 create project from template, This option will generate a project template, reducing the workload of post-configuration
Insert picture description here
4.Name the project, Other defaults, generally do not need to be changed
Insert picture description here
5. Complete the project creation, the project structure is as follows
Insert picture description here

Configuration item

1. Import the external class library and publish it to the Tomcat server.

in caseDon't do this, There is no error when running locally, butAfter publishing to the server, it will throw a ClassNotFoundException

Find file → project structure in the menu bar…
Insert picture description here
select modules…
Insert picture description here
select the jar package path
It is recommended to put jar packages commonly used in development in a folder
Insert picture description here
Click Finish to
Insert picture description here
add the selected √ before the class library appears after Problems in a circle 1
Insert picture description here
Click Fix, ... Select the Add
Insert picture description here
2. Configure the Tomcat server
, if not the beginning of a Tomcat server configuration, you need to click add configurtion in the top right idea ...
Insert picture description here
then Click + to add Tomcat server
Insert picture description here

If the server has been added when creating a new project, proceed directly to this step.
Click the Tomcat server in the upper right corner of the idea, and select the first edit in the drop-down box
Insert picture description here

Configure Tomcat server
Insert picture description here
Insert picture description here


OK, the end.

Guess you like

Origin blog.csdn.net/weixin_44580492/article/details/107335967