MAVEN Series Teaching Materials (6) - Create MAVEN-style JAVA WEB Projects in ECLIPSE
Article directory
- MAVEN Series Teaching Materials (6) - Create MAVEN-style JAVA WEB Projects in ECLIPSE
- 1. Steps to use
-
- Step 1: Create a new Maven project (by the way, remember to delete the previous j2se project)
- Step 2: Click Next on this interface
- Step 3: Fill in further information
- Step 4: In this way, a web app project is obtained
- Step 5: Create java source code directory
- Step 6: Add the servlet jar package through pom.xml
- Step 7: After adding, the index is not wrong
- Then the classic hello world
1. Steps to use
Step 1: Create a new Maven project (by the way, remember to delete the previous j2se project)
Step 2: Click Next on this interface
Step 3: Fill in further information
Step 4: In this way, a web app project is obtained
But there are two problems: the java source code directory is wrong, and the index is wrong
Step 5: Create java source code directory
In the screenshot of the previous step, it can be found that there is no place to store java source files. At this time, you need to follow the steps below:
Right-click the project->Properties->Java Build Path->Libraries->Edit->Workspace default
JRE(jdk8)- >Finish
Step 6: Add the servlet jar package through pom.xml
At this time, there is still the problem that index.jsp will report an error. The solution to this problem is to add the servlet.jar package.
insert image description here
You can click add to add the jar package. If the input package name cannot be prompted normally, you can manually enter the code to add the jar package