Java web Development

Source: Internet
Author: User

Java web Development

I. FAQs about Tomcat server startup:
(1). Java_home environment variable. Because some jar files in the bin directory of the tomcat server must use the java class library, you must configure the Java_home environment variable first.
(2) Port occupation Problems
(3) Catalina_home environment variable. If the catalina_home environment variable is configured, the tomcat server pointed to by catalina_home is started by default.


Ii. Tomcat directory structure:
(1). bin: stores script files for starting and disabling tomcat.
(2). conf: stores various configuration files on the tomcat server.
(3). lib: stores jar packages supported by the tomcat server.
(4). logs: stores tomcat log files.
(5). temp: stores temporary files generated during tomcat running.
(6). webapps: web application storage directory.
(7). work: tomcat working directory.


Iii. web application and virtual directory ing:
(1). virtual directory ing: After a web application is developed, the directory where the web application is located must be handed over to the web server for Management (virtual directory). This process is called virtual directory ing.
(2). There are several ways to implement virtual directory ing:
I. configure a Context in the server. xml file to point to a web application. In this way, restart the server.
II. create an xml file under $ catalina_base $/conf/enginename/hostname/. The file name is the virtual directory corresponding to the web application (ROOT indicates that the application is the default application ), then, you only need to configure the path of the web application in the file.
III. Tomcat automatically manages web applications under webapps and maps them to virtual directories.


Iv. Organizational Structure of web applications:

 


5. Configure the VM:
(1). to configure the VM, you only need to add Node
(2). If the configured virtual host needs to be accessed by the outside world, it must be registered on the dns server (buy a domain name) or the hosts file in the windows system.
(3) configure the virtual host in the server. xml configuration file.


6. web Resource Access process:
(1). I. Enter the network in the browser, start to find the ip address of the host (windows or dns), find the corresponding ip address, and connect to the corresponding server.
II. The client sends an http request to the host. The host parses the requested host and application from the request information, searches for the corresponding resources, reads these resources, and sends an http Response to the client.
III. After the browser receives the response, it parses and displays the http response.
(2) compress the web application into a war package, jar-cvf **. war **, and service chess automatically decompress the war package.


VII. Tomcat architecture:


8. Configure Tomcat Manager:
1. You can configure the user name and password in the tomcat-users file under the conf directory. To enter the manager page, you must configure the user role as manager.


8. Understand the http protocol:
1. telnet ip port --> GET resource path HTTP/1.1 Host: (not specified, several default hosts), you can request the corresponding page from the Host.
2. view it through http watch.


9. http requests and request methods:
1. http requests include request lines, request headers, and object data (there is an empty line between message lines and data)


2. There are two http request methods: get and post (form). The main difference between the two methods is data transmission.
: Get -->/mail/1.html? Name = abs & pwd = 123 (URL parameter method). put --> transmitted data

 

10. Explanation of http request header fields:
Accept: text/html, image/* --> file types supported by the client
Accept-Charset: iso-8859-1 --> client encoding method
Accept-Encoding: gzip --> compression format supported by the client
Accept-language: zh-cn --> client language environment
Host: www.sina.com --> Host name to be accessed by the client
If-Modified-Since: --> the client tells the server resource cache time (the browser usually caches the webpage to speed up access. if the access time is not updated after the access time, the client directly accesses the cache)
Referer: --> the client informs the server of the resource from which the server is accessed, which is mainly used for anti-leech protection.
User-Agent: --> client software environment
Cookie:
Connection: close/keep-Alive --> after this request, keep the Connection or close the Connection.
Date: --> client request time


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.