JSP 8 kinds of HTTP request way of the page composition, etc.

Source: Internet
Author: User

HTTP request method: The http/1.1 protocol defines eight methods (sometimes called "actions") to indicate the different modes of operation of Request-url specified resources 1, options returns the HTTP request method that the server supports for a specific resource, You can also use a request to send a ' * ' to the Web server to test the functionality of the server 2, the head to the server with a GET request consistent response, but the response body will not be returned. This method can get the meta information contained in the response small message header without having to transmit the entire response content. 3. Get makes a request to a specific resource. Note: The Get method should not be used in operations that produce "side effects", such as in Web application, where a get can be accessed randomly by a spider. The GET Request function in LoadRunner: Web_link and Web_url4, Post submits data to the specified resource for processing requests (such as submitting a form or uploading a file). The data is included in the request body. A POST request may result in the creation of new resources and/or modification of existing resources. LoadRunner the corresponding POST request function: WEB_SUBMIT_DATA,WEB_SUBMIT_FORM5, put upload its latest content to the specified resource location 6, delete request server deletes the resource identified by Request-url 7, Trace echoes the requests that the server receives, primarily for testing or diagnostics 8, which is reserved in the connecthttp/1.1 protocol to proxy servers capable of changing connections to pipelines. Note: 1) The method name is case-sensitive, and the server should return a status code of 405 (Mothod not allowed) when a request is directed to a resource that does not support the corresponding request method, and should return a status code 501 when the server does not know or does not support the corresponding request method (not Implemented). 2) The HTTP server should at least implement the Get and Head/post methods, the other methods are optional, and in addition to the methods described above, a specific HTTP server supports extending the custom method.

JSP pages consist mainly of 6 elements: directives, annotations, scripts, declarations, expressions, static content (HTML is not discussed)

1. Directives

Page directive, include directive, taglib directive

Page instruction Format:

<%@ page language= "Java" import= "java.util.*" pageencoding= "UTF-8"%>

Common Properties: Language, import, pageencoding

2. Notes

JSP comments are divided into 2 types: HTML annotations and script annotations

HTML comments:

<!--HTML annotations-client-visible <%--html annotations--%> client not visible

Script comments:

Single-line comment/**/Multiline comment

3. Script (Java code executable in JSP)

Format:

<% Java Code%>

4. Declarations (defining variables and methods)

Format:

<%! Java Code%>

5. Expressions

<%= expression%> does not end with a semicolon

Finally, add a JSP page life cycle

The user makes the request, if it is the first time the JSP file is converted into a servlet generated bytecode file, and then interpreted to execute, if not the first request, will directly explain the execution of the generated bytecode file

JSP 8 kinds of HTTP request way of the page composition, etc.

Related Article

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.