1 directory structure
The bin ? Binary directory, the main storage is some of the start and Stop server command startup.batconf ? config directory, server.xml web.xmllib ? What are the third-party jar packages used by the server software logs ? Log information when the server software is running temp . Directory for temporary file storage WebApps ? The working directory of the Web site that the developer needs to deploy , The main responsibility is to translate and compile the work
2 IDE Integration
If you need to use myeclipse every time you develop a website, you need to deploy it to Tomcat after you have developed your site. It is cumbersome to start the installation directory of Tomcat and deploy the site information manually every time.
Therefore, Tomcat needs to be integrated into the MYECLISPE.
Window? Preferences? Servers? Tomcat6.x? Enable? Tomcat installation root directory? JDK? Choose your own JDK? Launch?debug Mode| run Mode?path? Apply? OK
3 Experience the release of the website
- Create a folder of your own website JNB
- Create a static Web page in the folder of the website index.html
- Deploy the JNB Web site to the Tomcat server for Management
Copy directly to Tomcat's WebApps directory
- Start the Server Software
- Directly open the browser to enter the following URL to access
Http://127.0.0.1:8080/jnb/index.html
View the results of the operation as follows:
4 Development and publishing of Web sites in the IDE
The IDE enables you to develop, publish, and access Web sites in a way that is quick and easy to use.
Create: Package view à right-click Ànewàweb projectà Enter project information àfinish
The first button in the Publish: à select a project to publish Àadd add the Server software to be published Àdesploy
Start: The second button in the Select the Server software to start Àstart
Access: The third button in the input URL à enter
5 directory Structure of the website
The following directory structure is a directory structure that a dynamic Web site must have. -----| Site name folder (Web project name)--------| Static Resources 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 to run the required jar package ------------| configuration file for Web. XML website --------| Meta-inf Myeclispe generated meta-Information folder
Deployment of the site
Deploy the website directly to the Web server for management and provide the ability to directly enter URL access is called a site deployment.
? Automated Deployment is the WebApps directory that is directly written to the Tomcat directly in a published or copied manner. Disadvantages: 1 . The number of folders stored in any folder in the operating system is limited. 2. It's impossible to see directly in the real world. WebApps Directory Advantages: Convenient and quick
? Upload a deployment development site and then use the tool to compress the war package directly? Use the management client provided by Tomcat to upload the site. upload the war package directly. Note: Do not delete the war file if it is automatically unzipped. Because these two files are related to one another. If deleted then all will be deleted. Cons: a) The number of folders stored in any folder in the operating system is limited. Pros: You can use no server-oriented copy
? Manually deploy the host element of the server.xml that requires configuration of the Tomcat installation directory <context path= /myitcast docbase=" C:\JNB /> The context element represents a specific Web site the value of the Path property is a URL path to access the site Docbase property value is the specific path advantage of the site on disk: can be removed from the management of Tomcat's WebApps directory. Cons: Reboot required.
? Recommended deployment If you want to configure a Web site, but the site is on a different disk, you can create a file with a suffix of. Xml. The name of the file will be used as the path to access the Web site, the value of the Path property. If you need access to a multi-level path, you need to separate the file name with # for the basic name. /a/B then the file name must be 2#b.xml. If you want your site to be the default, then you need to define the file name as Root.xml. If the site needs to be the default Web site, you must restart the server. %tomcat_home%\conf\catalina\localhost myitcast.xml <context docbase=" C:\JNB "/> http://localhost:8080/myitcast
Javase Study Note-tomcat (8)