Explain the difference between JSP and servlet?
Servlet | JSP | |
---|---|---|
1. | Java code | HTML-based code |
2. | Acts like a controller in MVC. | View for showing output in MVC approach. |
3. | Accepts protocol requests. | Accepts only HTTP requests. |
4. | May override service() method. | Not possible to override service() method. |
BY Best Interview Question ON 19 Jan 2019