`
sasipa90
  • 浏览: 14677 次
  • 性别: Icon_minigender_1
  • 来自: 长沙
最近访客 更多访客>>
社区版块
存档分类
最新评论

Web Application Architecture: Container

阅读更多
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.
分享到:
评论

相关推荐

    Go Web Development Cookbook2018

    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,...

    Java_for_the_Web_with_Servlets

    - **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...

    ArcGIS Server JAVA ADF

    - **Web容器(Web Container):**支持基于Web的应用,如JSP或Servlets。 - **EJB容器(EJB Container):**适用于更复杂的企业级应用。 #### 三、Java ADF 系统开发 **1. Java ADF 构成** - **J2EE 应用服务器...

    Experience J2EE! Using WebSphere Application Server V6.1

    - **1.2.5 Container architecture**:深入探讨了容器架构的概念,解释了容器是如何管理和协调J2EE组件的生命周期的。 **1.3 Introduction of the scenario** 这里作者引入了一个具体的场景案例,帮助读者理解如何...

    程序员常用600词汇.docx

    9. Associated Container:关联式容器 Associated Container 是一种容器,它可以存储某种类型的数据,并提供了某些基本操作,例如插入、删除和查找等。 10. Atomic:不可分割的、原子的 Atomic 是指某个操作是不...

    Apache Geronimo 2.1_ Quick Reference.pdf

    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 ...

    组合型智能客户端应用 With Composite Application Block

    CAB的关键概念包括模块化(Module)、容器(Container)、工作台(Workbench)、事件模型和依赖注入。这些概念有助于实现代码的解耦,提升系统的可扩展性和可维护性。 **价值与优势** 采用CAB框架可以带来以下好处...

    IBM 软硬件解决方案

    - **Web Container**:处理HTTP/S请求,运行Servlets和JSP页面。 - **EJB Container**:管理Enterprise JavaBeans的生命周期。 - **Client Application Container**:支持客户端应用程序的运行。 ##### 应用服务器...

    慢谈J2EE

    2. **应用客户端容器 (Application Client Container)**:支持桌面客户端应用程序的运行。 3. **Web 容器 (Servlet 和 JSP 容器)**:负责Web组件的生命周期管理,如Servlet和JSP页面。 4. **EJB 容器 (Enterprise ...

    Building.Your.Next.Big.Thing.with.Google.Cloud.Platform.1484210050

    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 ...

    apache hadoop 2.7.2.chm

    Web Application Proxy YARN Timeline Server Writing YARN Applications YARN Commands NodeManager Restart DockerContainerExecutor Using CGroups Secure Containers Registry YARN REST APIs ...

    Java EE规范各个版本的比较V1.0.doc

    - **Administration and Deployment**:Apusic提供了基于Web的管理中心和Eclipse基础的GUI管理控制台,支持Java EE Management(JSR 077)和Application Deployment(JSR 088)。 这些版本之间的对比展示了Java EE...

    基于ssm的“典古”玩具销售的设计与开发论文.doc

    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在分布式环境下的底层结构(外文翻译+文献综述).rar

    J2EE支持两种事务管理模型:Container-managed Transactions(容器管理的事务)和Application-managed Transactions(应用管理的事务)。前者由应用服务器自动管理事务的开始、提交和回滚,后者则由开发者在代码中...

    Test-Drive ASP.NET MVC

    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 ...

    Spring Microservices

    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 ...

    j2ee 企业级开发

    - **应用服务器(Application Server)**:整合Web容器和EJB容器,提供其他服务如JMS、JTA等。 **五、J2EE核心技术** 1. **Servlet**:服务器端的小程序,用于扩展服务器功能,处理HTTP请求。 2. **JSP**:Java...

Global site tag (gtag.js) - Google Analytics