Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between Servlet and JSP? [duplicate]

Tags:

java

jsp

servlets

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

What is the Exact difference between the Servlet And JSP

like image 222
Kaushik Avatar asked Jan 20 '23 21:01

Kaushik


1 Answers

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

  • HTML
  • Custom Tags
  • Expression Language

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

like image 161
Sean Patrick Floyd Avatar answered Jan 28 '23 16:01

Sean Patrick Floyd