what is the difference between Servlet and JSP?Advantage of
JSP over Servelt?Any concept present in JSP which we cant
implement in Servlet?
Answers were Sorted based on User's Feedback
Answer / naina verma
Difference between servlets and JSP:
1. Servlet = HTML in java code.
JSP = java code in HTML.
2. Servlet support all protocols.
JSP only support HTTP protocol.
3. Servlet has more Dynamic content and less Static.
JSP less Dynamic content and more static content.
4. Servlet has business logic.
JSP has presentation and business logic both.
5. In servlet for any modification recompilation is done.
In JSP no recompilation is done for any modification.
6. Servlet is fast.
JSP is Slow.
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / d.sharath
servlet: its a java class so for every change we have to
compile the code to reflect the change.Mainly using for
writing business logics.
in jsp java code directly embeded into the html code
in jsp contains the ExpressionLanguage if in our
application development use EL to reduce the application
development time
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / sarfaraz sheikh
difference between Servlet and JSP::
Servlet::
1) It is a controller which is used into appllication to
collect inputs from end user and pass them to service layer.
2) It is service provider between presentation layer and
service layer.
3)It has less execution time as compare to JSP.
4)It is used to desighn static and dynamic pages for GUI.
5) Servlet doesent has implecit objects but there is an
option to make explicit objects.
6) We can be embeded html or plan text with servlet classes.
7)It suport to http and others protocol.
JSP::
1) 1) It is not controller which is used into appllication
only purpose of desighning GUI.
2) It is service provider between presentation layer and
service layer.
3)It has less execution time as compare to JSP.
4)It is used to desighn static and dynamic pages for GUI.
5) Servlet doesent has implecit objects but there is an
option to make explicit objects.
6) We can be embeded html or plan text with servlet classes.
JSP::
1) 1) It is not controller which is used into appllication
only purpose of desighning GUI.
2) It is service provider between presentation layer and
service layer.
3)It has less execution time as compare to JSP.
4)It is used to desighn static and dynamic pages for GUI.
5) Servlet doesent has implecit objects but there is an
option to make explicit objects.
6) We can be embeded html or plan text with servlet classes.
JSP::
1) 1) It is not controller which is used into appllication
only purpose of desighning GUI.
2) It is not service provider between presentation layer and
service layer but it is component of presentation layer.
3)It has more execution time as compare to servlet.
4)It is used to desighn only dynamic pages for GUI.
5) JSP has implecit objects to implements jsp code.
6) JSP allow to embeded java code into predifined jsp tages.
7) JSP only suport to http protocol.
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / hemant
here is a good reference http://blaze-core.com/difference-between-jsf-servlet-jsp/
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / sainath
1:)Jsp is used for input page devolopement and response page
developement sake.
But Servlets not for output generation, used only for
requesthandling,receiving request,processing data,and
communicate with db.
2:)Major problem with Servlet is that dynamic content
generationcode and presentationcode is tightly coupled
Incase of Jsp loosecoupling
Is This Answer Correct ? | 0 Yes | 1 No |
Answer / sonu
servlet is a java class.while jsp is a file.Internally when
we compile servlet will be generated from jsp file.jsp
complier will be the default one with all application
servers.Manually developed servlets perform more faster
than the servlets generated by the jsps.Jsp are used for the
display purpose only.In servlets we include the presentation
and business logic both
Is This Answer Correct ? | 4 Yes | 6 No |
Answer / pichha
Servlet is Servlet whereas JSP is JSP n also Servlet
Is This Answer Correct ? | 5 Yes | 7 No |
Answer / rajesh
Actually There is no difference bw Servlet and jsp
Both are aimed to achive the same result but in normall
usuage ,we can select a jsp as a View and serlvlet as a
container Since we need to seperate the Presentation logic
from Controller part as per MVC 2 architecture.
The question it self is not correct because all the Jsp
would end up in a servlet at LAST.
Thanks
Rajesh
Rajeshr1988@gmail.com
Is This Answer Correct ? | 4 Yes | 6 No |
Answer / sukanta kumar apnigrahi
servlet is a web component run in side server.it is easy to
write a application program ,it is advance version of html
program. we can't write html prog. in a servlet program.
JSP is a Java server page which is used to write a easy
and reliable java program.we can add HTML program in JSP.
It is slower than servlet.
Is This Answer Correct ? | 23 Yes | 29 No |
Answer / mkj
1 in jsp we can edbed the code in html tag even we can
create on tag. in servlet we must create java files .
2. for jsp there is no deployment mean web.xml is required
but servlet it required.
3 fast development in jsp but in servlet d process is long .
4.there is diffrence in compilation process..
Is This Answer Correct ? | 26 Yes | 40 No |
What is the difference between jsp and servlet life cycle?
Some examples where generic servlet is used?
how the HTML data stored in web server?
What is httpservlet class?
Explain the difference between a web server and a web container?
How servlets can be automatically reloaded?
What is the procedure of invoking different servlet in a different application?
How long do servlets last?
What happens, if server sends a cookie to a browser that doesn't supports cookies?
without session Id can we do any operations like add,update,edit,delete. I saw Session id is loaded for edit and delete action not for add .so am asking this
What are its drawbacks of cgi?
What is the difference between sendredirect() and forward() in a servlet?