JSP and JSTL Tutorials - Tutorial Addendum - Authoritative HTTP Acknowledgment Attack Curve
| |
(Continued from antecedent part...)
2. Acknowledgment attack lines: Advice about the response:
Accept-Ranges
Age
ETag
Area
Proxy-Authenticate
Retry-After
Server
Alter
WWW-Authenticate
3. Article attack lines: Advice about the data requested by the client:
Acquiesce
Content-Encoding
Content-Language
Content-Length
Content-Location
Content-MD5
Content-Range
Content-Type
Expires
Last-Modified
Controlling Attack Lines
When a PHP page is requested, the acknowledgment attack curve will be created by the
PHP engine. But you can ascendancy all attack curve with the header() function. Here
are rules and syntax of the header() function:
1. The syntax of header() is:
void header(string header_line[, bool replace[, int http_response_code]])
2. "header_line" specifies a complete attack band cord like "Content-Type: text/html".
3. "replace" can be acclimated to alter a ahead authentic attack band of the aforementioned identifier.
Default is replacing.
4. "header_line" can be acclimated to set the HTTP acknowledgment cachet band like "HTTP/1.1 200 OK".
5. header() haveto be alleged afore any achievement to the article body, if the achievement buffering is angry off.
6. If header() is alleged to set "Location" attack line, the cachet band will be set to "HTTP/1.0 302".
7. If header() is alleged assorted times, the cachet band will be consistently outputted first. Additional attack
lines will be outputted in aforementioned adjustment as their calling statements.
Viewing Attack Curve
When the applicant program receives the HTTP response, it will attending at the attack lines
first. Based on the advice independent in the attack lines, the applicant program will
decide what to do with the absolute acknowledgment data in the article body.
If you use a Web browser as a HTTP applicant program, it will action the data
in the article physique abnormally depending on mainly the "Content-Type" article attack line:
displaying the data as it is,
rendering the data as a HTML certificate and announcement the consistent information,
or casual the data to additional registered programs to handle it.
(Continued on next part...)
cket(host,port);
BufferedWriter w = new BufferedWriter(new OutputStreamWriter(
c.getOutputStream()));
BufferedReader r = new BufferedReader(new InputStreamReader(
c.getInputStream()));
Cord m = "GET "+ aisle + " HTTP/1.0";
w.write(m,0,m.length());
w.newLine();
w.newLine();
w.flush();
while ((m=r.readLine())!= null) {
System.out.println(m);
}
w.close();
r.close();
c.close();
} bolt (IOException e) {
System.err.println(e.toString());
}
}
}
(Continued on next part...)
|
header, lines, response, content, entity, client, information, status, called, program, replace, continued, location, controlling, string, , header lines, header line, http response, response header, client program, entity body, content type, status line, response header lines, header lines information, lines information about, header lines will, status line will, http response header, tutorials tutorial notes, tutorial notes controlling, notes controlling http, controlling http response, jstl tutorials tutorial, |
Also see ...
i(Continued from antecedent part...)/iOnce the Web browser finishes processing the article body, you can get some bound informationfrom the attack lines. For example, you can bang the appropriate abrasion button
i(Continued from antecedent part...)/i2. Command: "php HttpRequestGet.php /dot.gif" gives us: HTTP/1.1 200 OKServer: Microsoft IIS/5.1Date: Sun, 13 Nov 2005 04:40:17 GMTCon
i(Continued from antecedent part...)/iHere is the output: HTTP/1.1 200 OKServer: Microsoft IIS/5.1Date: Sat, 19 Nov 2005 02:28:32 GMTContent Type: text/xml;charset=utf 8br
i(Continued from antecedent part...)/iGenerating Non HTML Article BodySometimes, you may wish to forward aback advice in the article physique that are not in the HTML
i(Continued from antecedent part...)/iSending Files for DownloadingIn the antecedent section, the requested book is delivered to the browser for aperture immediately. p
This affiliate describes:What is a session.How use affair in a PHP script.A affair analysis with 3 scripts.How affair ID can be managed after
i(Continued from antecedent part...)/iSessionPage2.php: <?php SessionPage2.php Absorb (c) 2002 by Dr. Yang session_start(); $quantity = $_SESSION; $pr
i(Continued from antecedent part...)/iHere is my sample Perl program, reg_client.pl, advised to plan with my antecedent JSP allotment application: reg_client.pl Absorb (c) 20
What is a Custom Tag?Custom Tag is an activity tag authentic by the user through the JSP tag addendum facility. It can be acclimated to move JSP page assembly logics and advi
i(Continued from antecedent part...)/i3. Autograph the tag library descriptor (tld) file. Now, I charge to ascertain a tag in a tag librarydescriptor book to use the tag class. Actuality is my first tld file, HyT