Web Introduction to Web Application Development 2002 59
Webアプリケーション開発入門 Introduction to Web Application Development 大岩研究会 今野隆平 2002年 5月9日
今行われたことをプログラミングの面から見てみる do. Get(Http. Servlet. Request req, Http. Servlet. Response res){ res. set. Content. Type(“text/html”); GET /examples/servlet/Sample. Servlet Print. Writer out = res. get. Writer(); HTTP/1. 1 Accept: image/gif, image/x-xbitmap, out. println(“<html>”); image/jpeg, image/pjpeg, application/vnd. out. println(“<body>”); ms-powerpoint, out. println(“<h 1>Sample Servlet World</h 1>”); application/vnd. ms-excel, application/msword, */* out. println(“</body>”); Accept-Language: ja Accept-Encoding: gzip, deflate out. println(“</html>”); User-Agent: Mozilla/4. 0 } (compatible; MSIE 6. 0; Windows NT 5. 0) Host: localhost: 10000 Connection: Keep-Alive リクエスト・メッセージ n Content-Type: text/html Date: Wed, 08 May 2002 07: 32: 58 GMT Server: Apache Tomcat/4. 0. 1 -b 1 (HTTP/1. 1 Connector) Connection: close <html> <body> <h 1>Hello Sample Servlet World!</h 1> </body> </html> レスポンス・メッセージ クライアントに処理結果を反映させたレスポンスを送る
- Slides: 14