Maven skeleton to create a Java Web project

Maven skeleton to create a Java Web project

1) File -> New -> Project...

2) As shown below

3) As shown below

GroupId and ArtifactId<project name> and Version, the purpose of these three attributes is to identify the uniqueness of your project.

 

4) As shown below

5) As shown below

 6) After clicking Finish, Maven will create a Maven-based Web App based on the configuration just now.

       -After creation, its Log is as follows:

       -After creation, the code structure is as follows:

    recources folder: generally used to store some resource files
    webapp folder: used to store web configuration files and jsp pages, etc., which have formed an original web application

4. Start the Java Web project

1) Open "Project Structure"

2) Configure "Facets"

3) Configure "Artifacts"

4) Start "Edit Configurations"

5) Add New'Tomcat Server' configuration

6) Configure Deplyment

7) Configure Server

   The results are as follows:

8) Start Web Server

Now you can access the WebServer page through Browser.

 

5. Deploy the war file in Tomcat

    1) Copy MVNDemo.war to Tomcat's webapps directory.

    2) Visit the URL on Browser: http://localhost:8080/MVNDemo/.

6. Create Java Program Directory

1) Create java directory

2) Set the java directory as Sources

   Select the java folder, click Make as: Sources above, the folder will turn blue to save the java code, press OK.

Guess you like

Origin blog.csdn.net/sky2line/article/details/113101927