Idea, how to become a Web project with a project created using Gradle

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.