Web Application Architecture: Container
-------------------------------------------------
A Servlet doesn’t have a main method, but it still can be used, we run it, and use the Request and Response objects. Who will create the Servlet methods and who will create the Request and Response objects? The answer is the Container.
The container is an application on Java which controls the Servlet. His roles are:
-Communication Support: Our Servlet will talk with the web without creating a socket, without setting a port, all of that are done by the container.
-Life cycle: Servlet are supposed to be java class but we never create their object and never call their methods.
-Multithreading support: Each time the container receive a request, it will start a new thread and complete it after the running the HTTP method for that client request.
-Declarative security: The container itself will determine if the client is a sure and secure one.
-JSP Support: The container will change the JSP code into real Java.
How a container handles a request?
1.Get the request from the user by te URL
2.Create the HttpServletResponse and HttpServletRequest objects
3.Find the correct Servlet based on the URL
4.Call the method of service (doGet() or doPost())
5.Generate the dynamic page
6. Send the response object in the Http Response and delete the Request and Response objects.
分享到:
相关推荐
running a Go web application Docker container linked with another Docker container. Chapter 10, Securing a Go Web Application, demonstrates creating server certificates and private keys using OpenSSL,...
- **Application Architecture**: The architecture of a servlet-based application involves multiple components, including the servlet container (like Tomcat), which manages the lifecycle of servlets and...
- **Web容器(Web Container):**支持基于Web的应用,如JSP或Servlets。 - **EJB容器(EJB Container):**适用于更复杂的企业级应用。 #### 三、Java ADF 系统开发 **1. Java ADF 构成** - **J2EE 应用服务器...
- **1.2.5 Container architecture**:深入探讨了容器架构的概念,解释了容器是如何管理和协调J2EE组件的生命周期的。 **1.3 Introduction of the scenario** 这里作者引入了一个具体的场景案例,帮助读者理解如何...
9. Associated Container:关联式容器 Associated Container 是一种容器,它可以存储某种类型的数据,并提供了某些基本操作,例如插入、删除和查找等。 10. Atomic:不可分割的、原子的 Atomic 是指某个操作是不...
Sample web application accessing CORBA EJBs 214 Sample CSS 215 Deploying and running the sample 217 Summary 217 Chapter 8: Naming and JNDI 219 Application local JNDI context 219 resource-ref ...
CAB的关键概念包括模块化(Module)、容器(Container)、工作台(Workbench)、事件模型和依赖注入。这些概念有助于实现代码的解耦,提升系统的可扩展性和可维护性。 **价值与优势** 采用CAB框架可以带来以下好处...
- **Web Container**:处理HTTP/S请求,运行Servlets和JSP页面。 - **EJB Container**:管理Enterprise JavaBeans的生命周期。 - **Client Application Container**:支持客户端应用程序的运行。 ##### 应用服务器...
2. **应用客户端容器 (Application Client Container)**:支持桌面客户端应用程序的运行。 3. **Web 容器 (Servlet 和 JSP 容器)**:负责Web组件的生命周期管理,如Servlet和JSP页面。 4. **EJB 容器 (Enterprise ...
Whether you need a simple virtual server to run your legacy application or you need to architect a sophisticated high-traffic web application, Cloud Platform provides all the tools and products ...
Web Application Proxy YARN Timeline Server Writing YARN Applications YARN Commands NodeManager Restart DockerContainerExecutor Using CGroups Secure Containers Registry YARN REST APIs ...
- **Administration and Deployment**:Apusic提供了基于Web的管理中心和Eclipse基础的GUI管理控制台,支持Java EE Management(JSR 077)和Application Deployment(JSR 088)。 这些版本之间的对比展示了Java EE...
Tomcat, as a popular open-source web server and servlet container, ensures the smooth running of the application. In conclusion, the "DianGu" Toy Sales System, designed and developed using the SSM ...
J2EE支持两种事务管理模型:Container-managed Transactions(容器管理的事务)和Application-managed Transactions(应用管理的事务)。前者由应用服务器自动管理事务的开始、提交和回滚,后者则由开发者在代码中...
You’ll get hands-on experience building and deploying a time-management web application from start to finish. From building your first page, to data access, to integrating with web services such as ...
The Spring Framework is an application framework and inversion of the control container for the Java platform. The framework's core features can be used by any Java application, but there are ...
- **应用服务器(Application Server)**:整合Web容器和EJB容器,提供其他服务如JMS、JTA等。 **五、J2EE核心技术** 1. **Servlet**:服务器端的小程序,用于扩展服务器功能,处理HTTP请求。 2. **JSP**:Java...