How to create a Web project in idea and deploy it to Tomcat

Source: Internet
Author: User

Step 1:file->new Project,

Step 2: Select Project SDK for 1.7, Next Finish (JDK) my own is 1.7 (here project is not the same as project in Eclipse, where project is equivalent to workspace in Eclipse)

Step 3: Click Next---> Fill in your project name, specify your path

Step 4:

Create a moduleMouse point in the project name demos, right-click New, select Module, tick "Web application", confirm that "Create Web. xml" is checked.

Step 5: Create the classes and Lib files (classes is used to hold the compiled output of the class file, Lib is used to hold the third-party jar package. )

Step 6:

Configure folder pathFile, Project Structure (shortcut: Ctrl + Shift + Alt + S), select module: Select Paths, select the Use module compile output pat H, select the Classes folder that you just created for both output path and test output path.

Step 7: Then select Dependencies, select the Module SDK as 1.7, click "+" on the right, select 1 "Jars or Directories", select the Lib folder you just created-&G t; select "Jar directory" and then return to the OK on the line ~ ~

Step 7:

Configuring the Tomcat containerOpen menu Run, select Edit Configuration

Step 8:
Click "+" and select "Tomcat Server", select "Local"

Step 9: Enter the new service name at "name", click "Configure ..." after "Application Server", eject the Tomcat server window, select the locally installed Tomcat directory, OK

Step 10: In the "Run/debug configurations" window of the "Server" palette, uncheck "After launch", set "HTTP port" and "JMX port" (the default), click Apply, OK, This completes the Tomcat configuration.

Step 11:

deploy and run the project in TomcatRun, Edit configurations, go to "run/debug Configurations" window, select the Tomcat container you just created, select Deployment, click on the "+" sign on the right-&G T Select Artifact

Step 12:-> Select Web Project-application context can fill in "/hello" can also fill in your project name, feel free! (In fact, can not fill the ~ ~), OK

Step 13: Above is write Hello actually I then changed to write the name of the project is firstweb. Modify your index.jsp page and run the project directly on Tomcat.

The last thing I want to show is that idea is still smart, that is, when configuring Tomcat is a bit more troublesome than eclipse, he only has to publish the project on the default directly in the browser to give you access, do not manually enter the path, this is his more intelligent point.

How to create a Web project in idea and deploy it to Tomcat

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.