ALLInterview.com :: 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                      
Google
   
 
Categories >> Software >> Scripts >> JSP
 
 


 

 
 PHP interview questions  PHP Interview Questions (659)
 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)
Question
What is the difference between JSP and Servlet?
 Question Submitted By :: JSP
I also faced this Question!!     Answer Posted By  
 
Answer
# 1
Servlets are pure java programs.here 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 ?    196 Yes 71 No
Pratheeka Reddy
 
Answer
# 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 ?    101 Yes 13 No
Satyabrata
 
 
 
Answer
# 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"
errorPage="/page"

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
page.
 
Is This Answer Correct ?    76 Yes 11 No
Ranjan Satapathy
 
Answer
# 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
Xxxxxx
 
Answer
# 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
Sss
 
Answer
# 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
 
Answer
# 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
completely.
 
Is This Answer Correct ?    29 Yes 15 No
Y Ramakrishna
 
Answer
# 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
 
Answer
# 9
1)jsp is the tag oriented where as servlet are not the tag
oriented.
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 0 No
Amit Kharkia
 
Answer
# 10
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
Gaurav
 

 
 
 
Other JSP Interview Questions
 
  Question Asked @ Answers
 
How to find the hidden answers present in an online exam?   3
What is the most needed for STRUTS ? Trigent 2
Where we use assertion in java programming?   2
what type of question will be asked in the interview in this software field?????/// wbsedcl 2
What is the difference between Java Servlet & JSP?   1
What are actions and directives in jsp? Ocwen 3
why we use jsp as view NCS 3
how to connect the back end with Directive tag in jsp ...   1
what is the page attribute in JSP?   2
What Do you Mean By Object Serialization in java. Accenture 2
Plz any body tell me why use jsp over servlet.what is the benefit of jsp over servlet? HCL 4
hi friends...i created sessions in my login page i can able to create a session but after loging out again i can able access the pages by its addresses. i think u may got problem if possible post me small example for login with sessions including database   1
 
For more JSP Interview Questions Click Here 
 
 
 
 
 


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

ALLInterview.com   ::  KalAajKal.com