IntelliJ IDEA deploying Eclipse-created projects should pay attention

In the first use of IntelliJ IDEA, when you use the classes under the javax.servlet package (eg: javax.servlet.http.HttpServlet), you will find that the program cannot be successfully compiled in IntelliJ IDEA.
Because IntelliJ IDEA does not import the shelf package servlet-api.jar, you need to import the support manually;

the solution is as follows:
1. Click File-->Project Structure
2. Select Libraries at the left end of the pop-up window;
3. Click on a similar one at the top The icon of the plus sign "+";
4. In the pop-up window, select the directory where tomcat is located, enter the lib directory inside, and look for the jar package servlet-api.jar (if the JSP page also has related JavaWeb objects, you must also look for it jsp-api.jar; if there is only Servlet, only select servlet-api.jar);
7. Select the above jar package and click OK.
Import successful!
Click to start.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326448113&siteId=291194637