When idea was developing a project, using Gradle to build the project, after the package was referenced, it was discovered that idea did not correctly identify the project as a Web project.
There are two main points of performance:
1. The Resources directory of Src/main/resources No or have but the icon does not have three bars, the correct icon is:
Src/main/webapp The WebApp directory does not have or has but the icon does not have a center yellow dot, the correct icon is:
2. If you start to configure a configuration file such as Web. XML, *context.xml, *-servlet.xml, you will find that it is not recognized correctly, the contents of the file often turn red, the configuration is not found.
To resolve a Web project that is not recognized, use the facets configuration:
1. Open the Facets configuration
You can also use shortcut keys: Ctrl + ALT + SHIFT + S
2. After opening:
Select item:
Here is to say, pay attention to the selection of _main project, this is the main directory of our project.
The following interface appears:
Configuration is required, Deployment descriptors and web Resources directories, because the system configuration may be incorrect.
Deployment descriptors is the configuration Web. xml file, the default Web. XML location is system generated and needs to be configured as our own web. XML, the General directory is: Src/main/webapp/web-inf/web.xml. After the configuration is correct, the lower warning disappears.
The final and correct sample is:
Idea, how to become a Web project with a project created using Gradle