What happens when we request for a JSP page from web browser?

When a user calls JSP page from web browser, the request first comes to web server. Web server checks for .jsp extension of page and passes the request to JSP container like Tomcat.

The JSP container checks whether it has precompiled JSP class or not. If this is the first time this JSP is called, then JSP container will translate JSP into a servlet and compiles it.

After compiling, JSP code if loaded in memory and JSP container will call jspInit() method and _jspService() methods.

The _jspService() method will create the output that will be sent by JSP container to client browser.

Leave a Reply

Your email address will not be published. Required fields are marked *