:: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Categories >> Software >> Scripts >> JSP


 PHP interview questions  PHP Interview Questions (660)
 ASP interview questions  ASP Interview Questions (252)
 CGI Perl interview questions  CGI Perl Interview Questions (76)
 JavaScript interview questions  JavaScript Interview Questions (176)
 VB Script interview questions  VB Script Interview Questions (343)
 JSP interview questions  JSP Interview Questions (100)
 Shell Script interview questions  Shell Script Interview Questions (158)
 Python interview questions  Python Interview Questions (5)
 Tcl interview questions  Tcl Interview Questions (19)
 Awk interview questions  Awk Interview Questions (6)
 AJAX interview questions  AJAX Interview Questions (24)
 Ruby on Rails interview questions  Ruby on Rails Interview Questions (21)
 Scripts AllOther interview questions  Scripts AllOther Interview Questions (48)
What is the difference between JSP and Servlet?
 Question Submitted By :: JSP
I also faced this Question!!     Answer Posted By  
# 1
Servlets are pure java we can't use HTML.
But in JSP we use HTML,so we can use and modify the data
very easily.
Servlets are faster than JSP.bcoz while running JSP
programs it will be converted into Servlets and then
executed,so it takes more time.
Is This Answer Correct ?    198 Yes 71 No
Pratheeka Reddy
# 2
Both servlet and jsp are web components. But servlet is
best suited for request processing, handling the business
logic while jsp is suitable for content generating .Its
easy to include html tag in jsp rather than servlet.Also
jsp is compiled to servlet when first loaded to
webserver.So in many framework servlet act as a controller
while jsp as a view.Also implicit object and action
elements available in jsp but not in servlet.
Is This Answer Correct ?    102 Yes 13 No
# 3
Jsp is better for preparing presentation pages, while
servlet is good for request processing as it's more
difficult to write include, forward a static or dynamic url
with in out.println() ,

Jsp has also all implicit objects, we need not have to
instantiate any which is easier.

error handelling is easy in jsp isErrorPage="true"

we need not have to bother about init(),service(),destroy
(),doGet(),doPost()in jsp.

in servlet for each time changing we have to explicitly
compile it.

Jsp automatically compiled by container when we reload the
Is This Answer Correct ?    76 Yes 11 No
Ranjan Satapathy
# 4
1-The most important difference is that whenever we do some
changes in a servlet we need to build the application
completely but no need to do the same in case of jsp....
Is This Answer Correct ?    72 Yes 9 No
# 5
JSP is mainly used for presentation only. A JSP can only be
HttpServlet that means the only supported protocol in JSP
is HTTP. But a servlet can support any protocol like HTTP,
FTP, SMTP etc.
Is This Answer Correct ?    20 Yes 3 No
# 6
Like we all know both jsp's and servlets are used in web
applications.The only difference is we have html embedded in
java code in case of servlets making use of implicit
response objects and in case of jsp's it is java code that
is embedded in html code i.e.,what we call business logic
using scriplets(<%,%>).We have different applications for
both jsp's and servlets when we talk about flexibility we
opt for jsp's.It is because in case of servlets both
business logic and presentation logic are given by the same
java file ,so any change in presentation logic wll lead to
the entire compilation of the java file and replacing the
.class file back in the servlet container.When it comes to
jsp's we have both application and presentation logic
seperated.So even if u modify the presentation logic we need
not compile or modify any content of servlet engine.We are
aware of the modern web technologies advancements every day
and more over in the competing market environment it is
necessary to modify the look and feel of the page constantly
.So we prefer jsp's rather than servlets most of the
times.I do agree that servlets finds its application in
many cases but still jsp's can do the job for us.
Is This Answer Correct ?    17 Yes 2 No
Ravi Sekhar
# 7
A servlet and jsp's both are equal ,there could many
differences in that mainly one difference is a jsp's code
will internally convert to an servlet internally.

Also the person who use jsp's no need to know java
Is This Answer Correct ?    29 Yes 15 No
Y Ramakrishna
# 8
both servlet and JSP are same.Both are using to represent a
dynamic content to the user but their job is different.And
servlets are used for business logic whereas JSP are used for
presentation logic.If u want to present the data to the user once using servlets what you do is you put HTML with in java.if you want to present the data to the user once using JSP what you do is you put java with in HTML
Is This Answer Correct ?    4 Yes 0 No
Swetha Bammidi
# 9
The main difference between jsp and servlet is that in
servlet we write html code in java class and in jsp we write
java code in html page.Servlet is a java class.According to
MVC(model,view,controller) pattern servlet is used as
controller while JSP is used as view.
Is This Answer Correct ?    3 Yes 0 No
# 10
1)jsp is the tag oriented where as servlet are not the tag
2)for the servlet mpping is required where as for jsp no
mapping is required.
3)jsp files are saved by .jsp extension where as servlet
files are saved by .java extension.
4)servlets are more faster than jsp.
Is This Answer Correct ?    4 Yes 1 No
Amit Kharkia

Other JSP Interview Questions
  Question Asked @ Answers
Explain about the Scriplet and Exclamatory Tag? HCL 1
what are the alternate way to use the scriplet in jsp.   1
How can i connect from jsp to servlet page TCS 7
Can we use methods in JSP? If so where the methods are stored in servlet class file? Persistent 6
How to implement a thread-safe jsp page?   3
Write a Program using Servlet and JDBC for developing online application for displaying the details of Cars owned by the residents in XYZ society. Make necessary assumptions and create appropriate databases. ME 1
i am using rich faces datatable rich:datatable. On entering the value, values get filtered in table. Now how can i get the value in back9ing bean..?   1
how to set class path in java TechSoft 1
Are application, pageContext and object of ServletContext same or not?   2
how to connect the back end with Directive tag in jsp ...   1
we want to provide the errors to the right side of the text field so what we want to add in jsp pages? ITC-Infotech 1
Plz any body tell me why use jsp over servlet.what is the benefit of jsp over servlet? HCL 4
For more JSP Interview Questions Click Here 

Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
Copyright 2013  All Rights Reserved.   ::