what is the difference between Servlet and JSP?Advantage of
JSP over Servelt?Any concept present in JSP which we cant
implement in Servlet?
Answer Posted / fazal
1)A JSP is typically oriented more towards displaying
information, and a servlet is more oriented towards
processing information. For example, a JSP might display a
report, while a servlet would process a user submitted
form. These uses are not exclusive, but they are optimized
more for performing tasks in this manner. It is much easier
to incorporate HTML coding into a JSP than a Servlet. It is
also easier to write more complex Java code in a servlet.
2)JSP has Implicit objects and Servlets do not.
3)JSP and Servlet both define the server end functionality
to provide dynamic outputs ,As we know our HTML is only the
client end technology version which runs on client browser.
JSP and Servlet differ each other in terms of represntation
and execution cycle. Servlet are full functional java codes
that define the output like write to stream files in
protocol defined ways, JSP on the other hand is Role
Sepated format to do so where a ordinary web designer
designes how will be the presentation of the data and
Programmer defines the functinality to provide the
underlying things represented in conditional and non
conditinal ways , But here is the magic of JSp that merges
the both HTML represntation mixed with JAVA scriptlets.
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
What is a generic servlet?
Can you use javascript in servlets?
What is cookie? Why is cookie used?
Write a program to show the functionality of servlets.
How can we achieve transport layer security for our web application?
Difference between GET and POST?
How do I know if java is running on linux?
What are the advantages of cookies?
Which method is called when reference variable is passed in system.net?
What is servlet configuration?
What is url encoding and url decoding
Is it possible to have a constructor inside the servlet?
Why is http protocol called as a stateless protocol?
What is servlet and how it works?
How to create war file?