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:
- The client send an HTTPrequest
- The HTTP server receive it and transmit it to the servlet container
- The servlet container creates two objects for this HTTP request: HttpServletRequest and HttpServletResponse
- A servlet Instanciates a Bean and Initialise its properties:
SomeBean someBean = new SomeBean()
someBean.setProp("value")
- The servlet stocks the bean in the request as an attribute:
request.setAttribute("bean", someBean)
The servlet transmits the request to the JSP file:
this.getServletContext().getRequestDispatcher( "/WEB-INF/JSPFile.jsp").forward( request, response );
The JSPFile uses the information sent by the servlet:
package.SomeBean someBean = (package.SomeBean)
request.getAttribute("bean");
out.println( someBean.getProp());
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.