JSP is slower than Servlet. JSP is slower than Servlet because it must first be translated into Java code before it can be compiled. Modification in Servlet takes a long time because it requires reloading, recompiling, and restarting the server every time we make a change in our code.
The JSP engine converts the servlet into an executable class and sends the request to the servlet engine. The servlet engine is a component of the web server that loads and executes the Servlet class. During running, the servlet generates an HTML output.
The JSPs can only be called from the Controller servlet.
Figure 3 depicts the Model 2 architecture, which combines the use of servlets and JSP pages. JSP pages are utilised for the presentation layer, whereas servlets are used for processing duties in this mode. The servlet serves as a controller, handling requests and generating any beans required by the JSP page.
JSP is slower than Servlet. Because the initial stage in the JSP lifecycle is to translate JSP to Java code and then compile, JSP is slower than Servlet. All protocol requests are accepted by Servlet. Only http requests are accepted by JSP.
Share a personalized message with your friends.