Servlet is a class that written in java language and would respond to HTTP request and maintains the session. And JSP stands for JavaServer Pages and the purpose of it to create dynamic web pages based on HTML. So, what is the difference between them? The main difference between them is servlet is pure java but JSP is not. But we can put HTML code inside the HTML.