JSP Flow of Execution

JSP Flow of Execution

Now in this post let us see the Flow of execution of a JSP program. When we deploy the JSP Programs, it is the responsibility of the of the JSP Container to convert JSP programs into corresponding Servlet code. Every JSP container is having a JSP Compiler. It is the responsibility of the JSP compiler to convert/to run the JSP program. The following figure shows the steps that will be carried out when we deploy the JSP on top of server.

JSP program execution flow/execution steps
JSP Program Flow of execution
  • The client sends the request to server.
  • JSP compiler generates(converts JSP into servlet) the servlet code of  one.jsp and places it in a file named one.jsp.java.
  • Now the Java Compiler comes into picture. JavaC converts the Java code into Byte code, i.e, it generates the .class file.
  • Now server creates the servlet object and process the clients request.

The server will carry out all the above steps, when it got the request for the first time. When the client sends the same request for the second time, the server just executes the servlet object of the corresponding JSP program.

7 comments: