Eclipse project import and run JavaWeb

Environment: eclipse + tomcat8.5 + jdk8 + mysql

Import Project Flow
First click on File-> import
Here Insert Picture Description

选择existing projects into workspaceHere Insert Picture Description

① Select the directory, ② select items, ③ Click finsh
Here Insert Picture Description
after the import was successful, under normal circumstances, javaweb project, the upper left corner there is a sign balls. If so, indicate the import was successful, if not, that there is no import is successful, there may be introduced into the wrong way, there may be environmental no pairing
Here Insert Picture Description
can, to solve this problem by modifying the configuration
Eclipse Configuration
Configuration Project Facets, right-project, choose Properties, select Project Facets
first, make sure that Java option is selected, and then if Dynamic Web Module is not selected, then select it, and when you see a Furter configuration availabe (if not this, then selected, point apply, then canceled again apply, then there will be a point)
Here Insert Picture Description

Note that, after the point of the Dynamic web module Further configuration availabe, Content Directory needs to be filled in as src / main / webapp
Here Insert Picture Description

Modify the database configuration, there is a database behind url, name as you keep the name of the local database, have to change your password, do not have a user name (usually the default is root, if you know how to change the user, then this step for him, entirely superfluous)
Here Insert Picture Description

Project running, you can click on the top left corner of run (remember, first select the item and then click Run); Alternatively, you can right-click the project, Run-As -> Run on Server.

Remember, be sure to click on the project, the entire project, not a single java file, or jsp page

Here Insert Picture Description

Here Insert Picture Description

Published 74 original articles · won praise 37 · views 70000 +

Guess you like

Origin blog.csdn.net/exodus3/article/details/103942077