Step 10-JSP Definition

Comparison between Servlet and JSP-

Servlets are Java classes that handle HTTP requests and generate HTTP responses.JSPs are text files that contain a mixture of HTML and Java code, which is then translated into a servlet by the web server.
Servlets are typically used for more complex tasks such as handling form submissions, connecting to databases, and managing sessions.JSPs are typically used for simple tasks such as displaying dynamic data in an HTML template.
Servlets are more difficult to write and debug than JSPs, because they require more Java code.JSPs are easier to write and debug than servlets, because they contain less Java code and more HTML.
Servlets are more efficient than JSPs, because they are compiled into Java bytecode and can be reused across multiple requests.JSPs are less efficient than servlets, because they are interpreted at runtime and must be translated into a servlet before each request.

JSP- Java Server Pages

It’s used to create dynamic web applications like servlets, but it’s easier to maintain.

These are internally converted into servlets by server.

Jsp includes both html and jsp tags.
Html tags provides static output and jsp tags are provide dynamic output.