Understanding the whole process of a "web transaction"

81 Views Asked by At

I was doing some researches in order to understand the hole image of a "web transaction": the request from client to a server then the response from the server to the client.

The technologies concerned by my reads are : servlets container, servlet, JSP.

I summarize in the following steps what I've understood:

  1. The client send an HTTPrequest
  2. The HTTP server receive it and transmit it to the servlet container
  3. The servlet container creates two objects for this HTTP request: HttpServletRequest and HttpServletResponse
  4. A servlet Instanciates a Bean and Initialise its properties:

SomeBean someBean = new SomeBean() someBean.setProp("value")

  1. The servlet stocks the bean in the request as an attribute: request.setAttribute("bean", someBean)
  2. The servlet transmits the request to the JSP file:

    this.getServletContext().getRequestDispatcher( "/WEB-INF/JSPFile.jsp").forward( request, response );

  3. The JSPFile uses the information sent by the servlet:

    package.SomeBean someBean = (package.SomeBean) request.getAttribute("bean"); out.println( someBean.getProp());

  4. The JSPFile gets transformed to a servlet by the servlet container and sent to the client

The question: Correct me if I'm wrong, I want to understand the whole process.

0

There are 0 best solutions below