1 / 44
文档名称:

Advanced Servlet Techniques.pdf

格式:pdf   页数:44页
下载后只包含 1 个 PDF 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

Advanced Servlet Techniques.pdf

上传人:kuo08092 2015/3/6 文件大小:0 KB

下载得到文件列表

Advanced Servlet Techniques.pdf

文档介绍

文档介绍:65chapter3Chapter 3Advanced Servlet TechniquesIn This Chapter?Using sessions and storing state?Using cookies for long-term storage?Filtering HTTP requests?Understanding WebLogic Server deployment issues?Additional best practices for Web application developmentChapter 2 discusses the basics of handling HTTP requests and how to manage collections of Webresources. This chapter takes servlets a step further and discusses how to maintain informationbetween HTTP requests, how to improve code reuse with filters, and how to plan Web applicationdeployments on WebLogic to improve performance and and Web SessionsThe Hypertext Transfer Protocol (HTTP) is, by design, a stateless protocol. However, many Webapplications require information, previously gathered from the user, to process a request. With thisinformation, a servlet can remember a user’s name, items placed in a shopping cart, or a shippingaddress. The notion of saving information across multiple requests from a single client is typicallycalled a Web session. Linking this information from one request to another is session Information in a SessionIn the early days of the Web, developers found many ways to maintain session information. Brows-ers and servlet containers provided different mechanisms to store, retrieve, and track informationfrom one request to the next. Developers had to create their own session management , the servlet standard defines mon mechanism to maintain sessions. monmechanism, the servlet session, hides most of the plexities and allows developers toconcentrate on writing Web applications. Servlets place information into a session and retrieve thisinformation in subsequent requests. In this way, sessions add state information to the otherwisestateless HTTP Page 65 Monday, April 19, 2004 11:45 AM66Chapter 3 ? Advanced Servlet TechniquesSessions work by storing state information in a local object and creating a reference to tha