Java--tomcat Server

Source: Internet
Author: User

about Tomcat

Tomcat is an open source, free, small and medium-sized Web application server under the Apache Open source organization that supports the servlet and JSP specifications in Java EE.

installation

1, to the official website, select the appropriate version to download

2. Install Tomcat

Tomcat has installed version and press release (green version)

3. Directory structure

4. Start and close

Enter the bin directory./startup.sh//Run

./shutdown.sh//Off

5, enter http://localhost:8080 in the address bar of the browser, see the following page to prove the success of the launch

use idea to bind Tomcat and publish your app1. Create a Web project

Select Project SDK for 1.6 (if no SDK is configured first), File--New project, Next

Create Project from template page, uncheck any options, Next

Enter project name: Webdemo, Next, Finish

2. Start Configuration Project

Configure Project Structure
"F4" or Project Right "open module Settings" or the upper right corner has a black-blue box or menu bar "View"-"Open module Settings" entry

Configure Web. xml

Move Web-inf to a Web folder

Configure the source

Create two folders under the project-web-web INF classes and Lib

Configure paths
Modify the two output path to the address of the classes you just created

Configure Denpendencies
On the right there is a small green plus-JARs or directories ...

Select the Lib address you just created

Select Jar Directory

Okay, back.
The project is ready for deployment.

3. Configuring Tomcat

Configure Configurations

The menu bar "Run"-"Edit configurations" or the upper-right corner has a small downward arrow

New Tomcat Server
Reminder: Some people say there might not be a Tomcat Server option
IntelliJ 2016 Community Edition (i.e. free version) does not have Tomcat server this option, the paid version has
If it is a premium version, there is no Tomcat server option ... May not be checked (guessed) at the time of installation


Give the server a name
In the second tab, deployment
There's a green plus a artifact on the right.

The project has been automatically added in
Remember to enter the start address of the project in the right application context remember to add "/" ("/" will be automatically generated, and the following ABC can not be written, when accessed directly with localhost:8080 access)

Modifying the compilation Directory

then click OK.
After the panel changes, it proves that Tomcat is well-equipped.

4. Operation

Write some text in index.jsp for easy observation of test results

Click the Green Run button in the top right corner, wait a moment, and wait until the project is loaded and ready to access the


Output logs
You can then enter the startup address of the project (that is, the address in 2.3) from the browser to view the

Java--tomcat Server

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.