Run the CMD command to enter
Telnet localhost 8080 press ENTER
// First write the following two lines, paste them to the command line, paste the content above is invisible, and then press ENTER twice to get the result.
Post/test/login. jsp HTTP/1.1
HOST: localhost press enter (two press returns)
The result is as follows:(The following is a self-written JSP page, which is displayed in the POST method)
HTTP/1.1 200 OK
Server: APACHE-Coyote/1.1
Set-COOKIE: JSESSIONID = 00cfcba663892ec713fd9bdb7a02ba32; Path =/test/; HTTPOnly
Content-Type: text/html; charset = UTF-8
Content-Length: 867
Date: Wed, 18 Apr 2012 14:07:54 GMT
<! Doctype HTML public "-// W3C // dtd html 4.01 transitional // en">
<HTML>
<Head>
<Base href = "http: // localhost: 80/test/">
<Title> my JSP 'login. jsp 'starting page </title>
<Meta http-equiv = "Pragma" content = "no-Cache">
<Meta http-equiv = "cache-control" content = "no-Cache">
<Meta http-equiv = "expires" content = "0">
<Meta http-equiv = "keywords" content = "keyword1, keyword2, keyword3">
<Meta http-equiv = "Description" content = "this is my page">
<! --
<LINK rel = "stylesheet" type = "text/CSS" href = "styles.css">
-->
</Head>
<Body>
<Form action = "login" method = "Post">
Username: <input type = "username" name = "username"> <br>
Password: <input type = "password" name = "password"> <br>
<Input type = "Submit" value = "Submit"> & nbsp;
<Input type = "reset" value = "reset"> <br>
</Form>
</Body>
</Html>
**************************************** **************************************** **************************************** ********
// Login is the value of URL-pattern in Web. xml.
Telnet localhost 8080 press ENTER
GET/test/login HTTP/1.1
HOST: localhost press ENTER
(The result is omitted ...)
Telnet www.sina.com.cn and press ENTER
GET/index.html HTTP/1.1
HOST: www.sina.com.cn press ENTER
(The result is omitted ...)
Head/index.html HTTP/1.1 press ENTER
HOST: www.sina.com.cn press enter (two press returns)
(The result is omitted ...)