Difference between JSPs and Servlets
• Both JSP pages and Servlets reside on the server. JSP pages are first translated into Servlets before execution.
• Servlets are chunks of Java code that respond to client requests but they get messy when it comes to generating content. They can be thought of as controller objects.
• JSP pages are more like web pages with embedded Java code. They can be considered as view objects.
• The first time a JSP is loaded, it is compiled into servlet code. This occurs only once, at translation time.
• Subsequent requests are executed by the compiled servlet code. Handling client requests occurs at run time.
• When you have a lot of coding and less of display, use a servlet, but if most of what you want to do is just displaying content with very little logic, use a JSP.
• JSP pages separate design of web page from programming logic. A JSP page is a HTML page with .jsp extension. Like servlets, JSPs have both a request and a response.