Methods for using IDEA 404 new web projects and solutions (for the first time to see)

There are many on the web about IDEA project created javaweb Bowen tutorial, but bloggers still want to write this blog post is to facilitate smarter than you bloggers too was troubled to learn at the beginning of the web. This article carefully watched bold font detailed description, may be able to solve your problem, oh.
The crowd:
1. IDEA compiler from My eclipse to first.
2. Just started learning web, the first time the students create web project.
Step1:

First, create project and select Java Enterprise this time other basic default, Application Server is installed in your tomcat, usually automatically, or else find themselves on the path to the installation manual. This is the first time to pay attention to detail, if the option is selected Java Application Server will not see the configuration options on the right, it would need to enter into the project inside and then manually configure tomcat.
Step2:
Creating the web-INF folder, two folders, right-new Directory, classes and lib, and then configure the folder. Click File-> Project Structure-> Modules-> path, and as shown, then the path of the path to the file into classes
Then click Dependencies-> + -> JARs or directores, select lib folder path. Pop-up option box select Jar Directory, the best Apply, OK to

Step3: simple step is likely to cause a 404 not found error follow-up operation interface appears, if the choice is in front of Java Web Application from scratch, then you need to configure. Click Edit Configurations-> + -> Tomcat Server-> local

Then see the palette, basically by default, Name can be any, identified as browser settings to open the default browser page. Below is the port number. Warning that appears click fix just fine.

Very important, whether you are creating or engineering choice is Java Java Enterprise point to configure tomcat in this step, and then point to Deployment pulled lowermost this Application context to fill in to see if there is anything, if there is please delete out, otherwise an error 404nof found will appear in the first run when the web.
Or browser to open pages plus / content side and on file here at address.
For example: localhost: 8080 // index.jsp, we need to change localhost: 8080 // (Application context the contents) /index.jsp will be able to display your page up
Written in the last, because bloggers do anything to find a solution to many of the 404 not found, and then slowly to find the problem only to find, because it is write-only web application in IDEA ran it up feel very sad QQQQ. Fortunately, finally found the problem. The Application context when there is a need to configure multiple projects, if you learn early web applications when there may not write it first.

Guess you like

Origin juejin.im/post/5e8ee6276fb9a03c8b4c01c2