IntelliJ Idea2016.1,gradle Create a Java Web application __HTML5

Source: Internet
Author: User
Tags java web tomcat server
I didn't intend to write this, but I had a message from the last blog that I could not use Gradle to create a Java Web application. Of course, and gradle is actually much simpler and more convenient than Maven. Then let us witness together.

1. The following figure, the first step is very simple, file->new->project

2. The following figure, after completing the first step, pops up a form, then finds Gradle in the left column, and then on the right, check the Java and web two options, next.

3. The following figure, to the input groupid and Acrtifactid window, for the explanation of these two names, you can see the third step of Maven's creation of a Java Web project is explained, next.

4. The following figure, this page, just came in the default selection is use default Gradle wrapper (recommended), I do not choose this is because I have a local installed Gradle, all do not need to use it by default, if you select it, then create a project, It will automatically download Gradle, and then configure the download process is generally very slow, at least I am slow on my computer. All I choose is use the local gradle distribution,. And then there is a check, is automatically create an empty root folder, if not selected, the creation of the project will not have a Java folder, so tick, let it automatically create it, next.

5. The following figure, which defaults to the name of Artifactid, the unique identification of the project, then module name, if you do not know what to fill, you can follow the default does not matter, click Finish, the creation is done.

6. After the creation, if you have not configured Tomcat before, it is not possible to run, so also need to configure Tomcat, the following figure, the left is the successful creation of the project file directory, if not previously checked create directories for empty content Roots automatically, then the Java and resource this two-hole folder will not be generated. This is not the point of clicking Edit Configuration.

6. Eject the following picture configuration box, click on the upper left corner plus, scroll down to find Tomcat server->local, click Local.

7. The following figure, pop-up configuration box, the default is to configure the server properties, enter the name of this configuration, name, you can take any name, click Configure select Local Tomcat path, are configured to directly click OK can run.

8. The following figure, and then select the deployment next to the server, after the page, click the plus sign, in the pop-up page to choose the name of the longer one, that is, behind the (exploded), click OK.

9. As shown below, enter the name of the application context on the right, and this corresponds to the demo in the default path (http://localhost:8080/demo/), so if you don't configure this, Its default path will be (http://localhost:8080/). Finally click Apply, then click OK.

10. The penultimate step, the following figure, open the index.jsp page, rectangular circle out of the system generated by default, no pipe, you can delete, and then the circle is my own write. I just to let you know, the JSP page looks like, lest you see it, think is to generate the wrong file, click on the Run button with the top corner.

11. The final step is to witness the following results.

If you have any questions, please leave a message. Can be solved I will do my best, there is no good place to write, not clear place, can leave a message.

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.