What is the difference between Java Servlets and Java ServerPages (JSP)?
A JSP is a Servlet with a Web page flavor.There are more similarities than differences between the two.JSP uses its own tags which are ultimately using tag libraries implemented in Java.
The source code of a servlet with HTML embedded in out. print (...) statements, gives dynamic features to webpages but that makes a cumbersome process to maintain servelts from web design perspective.If someone has implemented GUI related code inside servlet then each time a small GUI change will result in recompilation of the whole code.Hence business logic centric development should be done inside servlet and JSP gives a choice of combining both in much targeted way.JSP was devised to differentiate the tasks of web designers,responsible for look and feel of the webpages, from web developers who deal in business logic development.So both entities have focused interest met through JSP.In fact, a JSP gets compiled into a servlet.
The source code of a servlet with HTML embedded in out. print (...) statements, gives dynamic features to webpages but that makes a cumbersome process to maintain servelts from web design perspective.If someone has implemented GUI related code inside servlet then each time a small GUI change will result in recompilation of the whole code.Hence business logic centric development should be done inside servlet and JSP gives a choice of combining both in much targeted way.JSP was devised to differentiate the tasks of web designers,responsible for look and feel of the webpages, from web developers who deal in business logic development.So both entities have focused interest met through JSP.In fact, a JSP gets compiled into a servlet.