Learn Java Training from the Best Tutors
Search in
What is difference between Servlet & JSP?
A Servlet is a Java class which extends the capabilities of servers that hosts the applications that are accessed using a model called request-response model. More importantly, servlets are used to extend the applications that are hosted by the web servers, and they can also respond to other types of requests too. For these type of applications, HTTP-specific servlet classes are defined by JAVA Servlet technology.
Difference between Servlet and JSP
Servlet | JSP |
Servlet is Java Code | JSP is HTML Code |
Writing code here is harder compared to JSP | JSP is easier to code than Servlet as it is Java in HTML |
It plays the role of a controller in MVC Approach | JSP is just the view in MVC Approach for showing output. |
It is faster than JSP | JSP is slower than Servlet as the first step in its lifecycle is the translation of JSP to java code and then compile. |
It can accept all protocol requests | It can only accept HTTP Requests |
We can override the service() method. | We cannot override its service() method. |
The default session management is not enabled, user have to enable it explicitly. | JSP session management is automatically enabled. |
We have to implement everything from a business logic and presentation logic in just one servlet file. | JSP business logic is separated from presentation logic by using JavaBeans. |
It is a time-consuming task because it includes reloading, recompiling and restarting the server. | Modification is faster, need to click the refresh button. |
read less
Related Questions
Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com
Ask a QuestionRecommended Articles
Why Java is the Most Popular Programming Language
Designed in a flexible and user-friendly demeanor, Java is the most commonly used programming language for the creation of web applications and platform. It allows developers to “write once, run anywhere” (WORA). It is general-purpose, a high-level programming language developed by Sun Microsystem. Initially known as an...
Why Should You Learn Java !
Java is the most famous programming language till date. 20 years is a big time for any programming language to survive and gain strength. Java has been proved to be one of the most reliable programming languages for networked computers. source:techcentral.com Java was developed to pertain over the Internet. Over...
Java: An Object-Oriented Language
Java is the most commonly used popular programming language for the creation of web applications and platform today. Integrated Cloud Applications and Platform Services Oracle says, “Java developers worldwide has over 9 million and runs approximately 3 billion mobile phones”. Right from its first implication as java 1.0...
Top 5 Reasons to Learn JavaScript
Before we start on the importance of learning JavaScript, let’s start with a short introduction on the topic. JavaScript is the most popular programming language in the world, precisely it is the language - for Computers, the Web, Servers, Smart Phone, Laptops, Mobiles, Tablets and more. And if you are a beginner or planning...
Looking for Java Training Classes?
Learn from the Best Tutors on UrbanPro
Are you a Tutor or Training Institute?
Join UrbanPro Today to find students near youThe best tutors for Java Training Classes are on UrbanPro
The best Tutors for Java Training Classes are on UrbanPro