欢迎来到毕设资料网! | 帮助中心 毕设资料交流与分享平台
毕设资料网
全部分类
  • 毕业设计>
  • 毕业论文>
  • 外文翻译>
  • 课程设计>
  • 实习报告>
  • 相关资料>
  • ImageVerifierCode 换一换
    首页 毕设资料网 > 资源分类 > DOC文档下载
    分享到微信 分享到微博 分享到QQ空间

    HTTP和Servlet基础外文翻译

    • 资源ID:135108       资源大小:82KB        全文页数:19页
    • 资源格式: DOC        下载积分:100金币
    快捷下载 游客一键下载
    账号登录下载
    三方登录下载: QQ登录
    下载资源需要100金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝   
    验证码:   换一换

     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。

    HTTP和Servlet基础外文翻译

    1、 中文 6727 字 翻译原文 作者: Hans Bergsten HTTP and Servlet Basics Lets start off this chapter by defining the term web application. Weve all seen regular client-side applications, but what exactly is a web application? Loosely, it can be defined as an application running on a server a user accesses through

    2、a thin, general-purpose client. Today, the most common client is a web browser on a PC or workstation, but other kinds of clients are rapidly joining the party, such as wireless PDAs, cell phones, and other specialized devices. The lofty goal here is to access all the information and services you ne

    3、ed from any type of device that happens to be in front of you. This means that the same simple client program must be able to talk to many different server applications, and the applications must be able to work with many different types of clients. To satisfy this need, the protocol of how a client

    4、 and a server talk to each other must be defined in detail. Thats exactly what the HyperText Transport Protocol (HTTP) is for. The communication model defined by HTTP forms the foundation for all web application design. A basic understanding of HTTP is key to developing applications that fit within

    5、the constraints of the protocol, no matter which server-side technology you use. In this chapter, we look at the most important details of HTTP you need to be aware of as a web application developer. One other item: this book is about using JSP as the server-side technology. JSP is based on the Java

    6、 servlet technology. Both technologies share a lot of terminology and concepts, so knowing a bit about servlets will help you even when you develop pure JSP applications. To really understand and use the full power of JSP, you need to know a fair bit about servlets. Hence, we look at servlet fundame

    7、ntals in the last section of this chapter. 2.1 The HTTP Request/Response Model HTTP and all extended protocols based on HTTP are based on a very simple communications model. Heres how it works: a client, typically a web browser, sends a request for a resource to a server, and the server sends back a

    8、 response corresponding to the resource (or a response with an error message if it cant process the request for some reason). A resource can be a number of things, such as a simple HTML file returned verbatim to the browser or a program that generates the response dynamically. This simple model impl

    9、ies three important facts you need to be aware of: HTTP is a stateless protocol. This means that the server doesnt keep any information about the client after it sends its response, and therefore it cant recognize that multiple requests from the same client may be related. Web applications cant easi

    10、ly provide the kind of immediate feedback typically found in standalone GUI applications such as word processors or traditional client/server applications. Every interaction between the client and the server requires a request/response exchange. Performing a request/response exchange when a user sel

    11、ects an item in a list box or fills out a form element is usually too taxing on the bandwidth available to most Internet users. Theres nothing in the protocol that tells the server how a request is made; consequently, the server cant distinguish between various methods of triggering the request on t

    12、he client. For example, HTTP doesnt allow a web server to differentiate between an explicit request caused by clicking a link or submitting a form and an implicit request caused by resizing the browser window or using the browsers Back button. In addition, HTTP doesnt contain any means for the serve

    13、r to invoke client specific functions, such as going back in the browser history list or sending the response to a certain frame. Also, the server cant detect when the user closes the browser. Over the years, people have developed various tricks to overcome the first problem; HTTPs stateless nature.

    14、 The other two problems no immediate feedback and no details about how the request is made are harder to deal with, but some amount of interactivity can be achieved by generating a response that includes client-side code (code executed by the browser), such as JavaScript or a Java applet. 2.1.1 Requ

    15、ests in Detail Lets take a closer look at requests. A user sends a request to the server by clicking a link on a web page, submitting a form, or typing in a web page address in the browsers address field. To send a request, the browser needs to know which server to talk to and which resource to ask

    16、for. This information is specified by an HTTP Uniform Resource Locator (URL): http:/ The first part of the URL shown specifies that the request is made using the HTTP protocol. This is followed by the name of the server, in this case . The web server waits for requests to come in on a specific TCP/I

    17、P port. Port number 80 is the standard port for HTTP requests. If the web server uses another port, the URL must specify the port number in addition to the server name. For example: http:/:8080/index.html This request is sent to a server that uses port 8080 instead of 80. The last part of the URL, /

    18、index.html, identifies the resource that the client is requesting. A URL is actually a specialization of a Uniform Resource Identifier (URI, defined in the RFC-2396 specification). A URL identifies a resource partly by its location, for instance the server that contains the resource. Another type of

    19、 URI is a Uniform Resource Name (URN), which is a globally unique identifier that is valid no matter where the resource is located. HTTP deals only with the URL variety. The terms URI and URL are often used interchangeable, and unfortunately, they have slightly different definitions in different spe

    20、cifications. Im trying to use the terms as defined by the HTTP/1.1 specification (RFC-2616), which is pretty close to how they are also used in the servlet and JSP specifications. Hence, I use the term URL only when the URI must start with http (or https, for HTTP over an encrypted connection) follo

    21、wed by a server name and possibly a port number, as in the previous examples. I use URI as a generic term for any string that identifies a resource, where the location can be deduced from the context and isnt necessarily part of the URI. For example, when the request has been delivered to the server

    22、, the location is a given, and only the resource identifier is important. The browser uses the URL information to create the request message it sends to the specified server using the specified protocol. An HTTP request message consists of three things: a request line, request headers, and possibly

    23、a request body. The request line starts with the request method name, followed by a resource identifier and the protocol version used by the browser: GET /index.html HTTP/1.1 The most commonly used request method is named GET. As the name implies, a GET request is used to retrieve a resource from th

    24、e server. Its the default request method, so if you type a URL in the browsers address field, or click on a link, the request is sent as a GET request to the server. The request headers provide additional information the server may use to process the request. The message body is included only in som

    25、e types of requests, like the POST request discussed later. Heres an example of a valid HTTP request message: GET /index.html HTTP/1.1 Host: User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv: 1.0.2) Accept: image/gif, image/jpeg, image/pjpeg, image/png, */* Accept-Language : en Accept-Cha

    26、rset : iso-8859-1,*,utf-8 The request line specifies the GET method and asks for the resource named /index.html to be returned using the HTTP/1.1 protocol version. The various headers provide additional information. The Host header tells the server the hostname used in the URL. A server may have multiple names, so this information is used to distinguish between multiple virtual web servers sharing the


    注意事项

    本文(HTTP和Servlet基础外文翻译)为本站会员(泛舟)主动上传,毕设资料网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请联系网站客服QQ:540560583,我们立即给予删除!




    关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们
    本站所有资料均属于原创者所有,仅提供参考和学习交流之用,请勿用做其他用途,转载必究!如有侵犯您的权利请联系本站,一经查实我们会立即删除相关内容!
    copyright@ 2008-2025 毕设资料网所有
    联系QQ:540560583