What is the difference between servlets and jsp?
In servlet,java will be used to generate dynamic HTML pages,but in JSP,java will be reduced and we can use our custom tags to generate HTML pages. Source: CoolInterview.com
Answered by: olymohamed | Date: 12/12/2007
| Contact olymohamed
In servlet if any change in your class file you must redeploy again but jsp only one you have to deploy. in compare to servlet jsp reduce code and contains implicit objects. Source: CoolInterview.com
Answered by: chitra | Date: 12/14/2007
| Contact chitra
Answered by: hariharan | Date: 12/15/2007
| Contact hariharan
What is the difference between servlets and Java Server Pages? Which is preferred?
Answered by: Margi Pancholi | Date: 12/17/2007
| Contact Margi Pancholi
(1)Bits of HTML embedded in java code.(2) Suitable for coding business layer of enterprise application.(3)Created and maintained by Java programmers
(1) Bits of java code embedded in HTML.
(2)Suitable for coding presentation layer of enterprise application
(3)Created and maintained by Web designers. Source: CoolInterview.com
JSP page has both presentation logic and business logic but servlet has only business logic and presentation logic is present in html file Source: CoolInterview.com
Answered by: sai | Date: 12/17/2007
| Contact sai
Jsp is nothing but a servlet.jsp is transfered to servlet by jsp engine.after converting it acts like a servlet.in servlets static content and dynamic content are combined.we can avoid this using jsp.we can separate static content from dynamic content.so this makes the application very flexible. Source: CoolInterview.com
Answered by: ranjith | Date: 12/24/2007
| Contact ranjith
Answered by: ranjith | Date: 12/25/2007
| Contact ranjith
In jsp html pages with javacode embedded inside of them.In servlets java programs with html embedded inside of them. Source: CoolInterview.com
Answered by: priya.s | Date: 1/3/2008
| Contact priya.s
In servlet java code can't embedded wih servlet's custome tag.
Answered by: Baskar | Date: 9/9/2008
| Contact Baskar
In jsp java code can embedded with jsp's custome tag Source: CoolInterview.com
JSP contains more static content and less dynamic content but servlet contains more dynamic and less static content. Source: CoolInterview.com
Answered by: muthu | Date: 12/19/2008
| Contact muthu
Servlet contains very indepth coding to develop any servlet web application.And also all logics are implemented in same servlets we get page centric problem.There is no implicits objects and by default servlet is not a threadsafe.It is not participating session by default.javax.servlet package.
Answered by: venkateswara reddy gunapati | Date: 6/7/2010
| Contact venkateswara reddy gunapati
when compare to servlets....
In jsp,Indepth java coding is reduced because of custom tags is used.And Business,Data acess logics are developed in different webpages.It means presentation logics are developed in jsp page and data acess logic developed in JavaBean class.It eliminates pagecentric problem. Jsp have its own implicit objects provided by container.Bydefault its participating in session.It is the subpackage of javax.servlet.jsp package.But both are available in same server. Source: CoolInterview.com
servlet:-1)mainly for business logic.
Answered by: M.Santosh Kumar | Date: 8/10/2010
| Contact M.Santosh Kumar
2)once compled a servlet,if any modifications then once again complie and re-deploy.
3)no implicit objects.
jsp:-1)mainly for presentation logic.
2)want to make changes go to the source jsp file and make changes,not need any recompilation.
3)implicit objects are there.
**** jsp== servlet ****
because,even if u write any jsp file at the back a servlet will be generated.
(for example if u r using tomcat as server then in "work directory "of tomcat there u can find the servlet. Source: CoolInterview.com
servlet is runs on the server.It has only business logic. jsp is mixing of html and java.
Answered by: Rahman khan | Date: 8/11/2010
| Contact Rahman khan
JSP page has both presentation logic and business logic. Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.