what is the difference between a servlet and jsp? or relation between them? how to execute .jsp file without .java file when we doesn't know the port number?
1)In MVC, jsp act as a view and servlet act as a controller.
2)JSP pages contain a mixture of HTML, Java scripts, JSP elements, and JSP directives while servlet is totally uses java code.
3)Java Server Pages are document-centric. Servlets, on the other hand, look and act like programs.
4)JSP is basically used for presentation and servlet is used for bussiness logic
5)Servlets are faster than jsp.
6)In Servlet, clientside validation is possible whereas clientside validation is not possible in JSP.
7)JSP has Implicit objects and Servlets do not.
8)Servlet contains pure java code while JSP does not.
For more information, visit the following: