JavaSE Study Notes-Tomcat (8) and javase Study Notes

Source: Internet
Author: User

JavaSE Study Notes-Tomcat (8) and javase Study Notes

1. directory structure

Bin binary Directory, which stores startup commands for starting and stopping servers. batconf configuration directory, server. xml web. the third-party jar package logs used by the xmllib server software records the log information during running of the server software temp temporary file storage directory webapps stores the working directory of the website work server that developers need to deploy, mainly responsible for translation and compilation

2 IDE Integration

If MyEclipse is required for each website development, it must be deployed on tomcat after the website is developed. It is cumbersome to start and manually deploy website information in the Tomcat installation directory each time.

Therefore, you need to integrate Tomcat into MyEclispe.

WindowPreferencesServersTomcat6.xEnableTomcat installation root directory JDK select your own JDK launchdebug mode | run modepathApplyOK

3. Experience website publishing

<H2> this is my first site! </H2>

Copy the file directly to the tomcat webapps directory.

Http: // 127.0.0.1: 8080/jnb/index.html

View the running result as follows:

4. website development and release in IDE

In IDE, you can quickly develop, publish, and access websites.

Create: Package view; right-click; enter project information; Finish

Release: Click the first button in. Select the project to be released. Click add to add the server software to be released. Click Desploy.

Start: select the server software to start.

Access: the third button in. Enter the URL. Press enter.

5. website directory structure
The following directory structure is required for a dynamic website. ----- | Website name folder (web project name) -------- | static resource HTML, CSS, JavaScript -------- | images folder *. jpeg *. bit *. gif -------- | dynamic resource *. jsp -------- | WEB-INF mainly stores the class file and class library ------------ | classes folder, compiled class file ------------ | lib folder, lass file run the jar package ------------ | web. xml website configuration file -------- | meta folder generated by META-INF MyEclispe

Website deployment

Deployment: the website is directly handed over to the web server for management, and the website deployment is called the ability to directly enter the website for access.

Automatic deployment is to directly publish or copy the compiled website to the tomcat webapps directory. Disadvantages: 1. The number of folders stored in any folder in the operating system is limited. 2. It is impossible to directly see the webapps directory in a real environment. Advantages: convenient and quick
After uploading and deploying the development website, you can use the tool to compress the war package and use the management client provided by tomcat to upload the website. Directly upload the war package. Note: Do not delete the war file if it is automatically decompressed. Because these two files are associated with each other. If deleted, all objects will be deleted. Disadvantage: a) the number of folders stored in any folder in the operating system is limited. Advantage: you do not need to copy data to the server.
Manually deploy the server that requires the tomcat installation directory. <Context path = "/myitcast" docBase = "c: the \ jnb "/> Context element indicates that the value of a specific website path attribute is a URL path to access the website. The docBase attribute value indicates the specific path advantages of the website on disk: it can be separated from the management of tomcat's webapps directory. Disadvantage: restart required.
We recommend that you deploy a website, but the website is on another disk. You can create a file with the suffix. xml. The file name will be used as the path to access the website, that is, the path attribute value. If you need to access multiple levels of paths, you need to separate the file names with the basic names. /A/B, the file name must be 2 # B. xml. If you want your website to be the default website, you need to define the file name as ROOT. xml. If the website needs to be the default website, you must restart the server. % Tomcat_home % \ conf \ Catalina \ localhost myitcast. xml <Context docBase = "c: \ jnb"/> http: // localhost: 8080/myitcast

 

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.