Data transmission oriented to B/s

Source: Internet
Author: User
Tags call back

The process by which data is transferred from the browser to the server:

1. The user submits the data in the browser's form form and submits it via the Post/get method

2. The data at this point is of type String, and then the browser transfers the data to the binary via the HTTP protocol to the server

3. The server receives the transmitted data, first into a string type, and then to the type of the respective requirements, the process can be filtered on the browser side

3. Submit the respective servlet processing according to the data transmitted from the specific page

4. The final server then includes the servlet-processed data in the JSP

5.jsp parse the result first, and then transfer the parsed data to the browser

6. The browser parses the received JSP page into an HTML page to show the user


How the browser stores the data that is received and how the data is stored in different domains is not the same, how the process is implemented

Four domain objects:

1.page Domain (PageContext)

Scope: Data is valid only on the current JSP page and cannot be accessed by jumping to another page

Storage: Server memory

2.request domain (or response domain)

Scope: Valid within a single request, valid range is request period, refresh page after recalculation, forwarding valid, redirect invalid

Storage: Server cache, no access operation, data in this domain only exists during request and response transmission

3.session Domain

Scope: A call back (from opening the browser to closing the browser), or browser process, only the browser does not close or within a specified time to generate the request, the session range of data has been valid

Storage: server memory, each time a reply will produce a SessionID, a client cookie, a server in memory, if the browser does not disable cookies, then SessionID exists in the cookie, each time, if the browser disables cookies, So SessionID exists in the browser

4.application domain (or applicationcontext,servletcontext)

Scope: The entire Web application, from the server open to the end of the server, the data in the application domain is shared, the data in other domains is isolated, as long as the Web server does not restart, has been effective

Storage: Server memory

Now there is a problem, that data is stored in server memory, how they are stored, how the server distinguishes the data in which domain



About encoding for web apps

JSP------binary-------HTML

The first process: pageencoding= "UTF-8" or response.setcharactorencoding ("Utf-8");

A second process: <meta name= "Content-type" content= "text/html; Charset=utf-8 ">request.setcharactorencoding (" Utf-8 ");



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.