HTTP和Servlet基础外文翻译
《HTTP和Servlet基础外文翻译》由会员分享,可在线阅读,更多相关《HTTP和Servlet基础外文翻译(19页珍藏版)》请在毕设资料网上搜索。
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.
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中设计图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- http 以及 servlet 基础 外文 翻译
