1. What is JSP Architecture?
Following steps includes the JSP Architecture as shown in the above figure.
- Web client sends request to Web server for a JSP page (extension .jsp).
- As per the request, the Web server (here after called as JSP container) loads the page.
- JSP container converts (or translates) the JSP file into Servlet source code file (with extension .java). This is known as translation.
- The translated .java file of Servlet is compiled that results to Servlet .class file. This is known as compilation.
- The .class file of Servlet is executed and output of execution is sent to the client as response.
Let us write more clearly of the above steps.
2. What is JSP translation or JSP parsing?
3. What is Page Compile Servlet?
The JSP container converts the JSP file into a Servlet source file with extension .java. It is simply as equivalent you write a Servlet file. That is, instead of you write a Servlet file, container writes (as per the source code of JSP file). That means, a JSP file is converted into a Servlet internally. This is known as translation and translation phase. Some people call it as parsing. To do translation, some tools use PageCompileServlet. Of course, it is entirely IDE tools or Container software dependent. Resin JSP container uses JspPrecompileListener and JspCompiler. Ecplise puts everything in a WAR file.
4. What is JSP compilation?
The JSP container software compiles the Servlet source code (.java file) into a Servlet .class file. This is known as JSP compilation.
5. What is JSP execution?
The .class file of Servlet is executed by the JSP container and the output of execution is sent to client as response. If the same JSP file is not used again, the .class file is deleted. If used again and often, the .class file is retained by the container for further usage without the need of second time translation and compilation. This is to increase the performance.
Follow the steps and is important to know what happens at what level.
Note: A Web client and Web server are simply a client and server but connected to Internet (Web). Here, Internet is the interface between client and server for communication.