4

Possible Duplicate:
What is the difference between JSF, Servlet and JSP?

What is the Exact difference between the Servlet And JSP

0

3 Answers 3

6

A JSP is a special kind of Servlet that is edited in a HTML-like syntax and compiled into Servlet byte code by a web container (usually at deploy-time or when first accessed).

JSPs can contain complex Java code, however that has been considered a bad practice for the last 8 years or so, so JSPs will usually only contain

(Judging by the age of the above links you can tell that JSP is not exactly cutting-edge anymore)

Sign up to request clarification or add additional context in comments.

Comments

2

JSP is a template language that the servlet/JSP engine compiles into a servlet, which is then compiled into Java byte code and executed.

Think of JSP as a convenient HTML factory.

Comments

1

Simply, Servlet is Java code that outputs HTML. JSP is the opposite, it's HTML that has Java code inside tags.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.