专业(方向):计算机科学与技术(应用) 班级: 计本06-1班 学生: 赵兴哲 指导教师: 董明刚 日期: 2010年4 月 Enter ActionMappings The Model 2 architecture (see chapter 1) encourages us to use servlets and Java- Server Pages in the same application. Under Model 2, we start by calling a servlet. The servlet handles the business logic and directs control to the appropriate page plete the response. The web application deployment descriptor () lets us map a URL pattern to a servlet. This can be a general pattern, like *.do, or a specific path, like . Some applications implement Model 2 by mapping a servlet to each business operation. This approach works, but many applications involve dozens or hundreds of business operations. Since servlets are multithreaded, instantiating so manyservlets is not the best use of server resources. Servlets are designed to handle any number of parallel requests. There is no performance benefit in simply creating more and more servlets. The servlet’s primary job is to interact with the container and HTTP. Handling a business operation is something that a servlet could delegate to ponent. Struts does this by having the ActionServlet delegate the business operation to an object. Using a servlet to receive a request and route it to a handler is known as the Front Controller pattern [Go3]. Of course, simply delegating the business operation to ponent does not solve the problem of mapping URIs [W3C, URI] to business operations. Our only way municating with a web browser is through HTTP requests and URIs. Arranging for a URI to trigger a business operation is an essential part of developing a web application. Meanwhile, in practice many business operations are handled in similar ways. Since Java is multithreaded, we could get better use of our server resources if we could use the same Action object to handle similar operations. But for this to work, we might need to pass