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 do you mean by deployment descriptor?
Explain the differences between jsp and servlet.
What do you mean by request dispatcher in servlet? Also explain its methods.
How we can create war file in servlet?
Write a command to get actual path of a servlet to the server?
How to read request headers from servlets?
explain the advantages of servlet life cycle?
How servlet is created?
Why do we have servlet listeners?
What exactly are the functions of servlet?
Can we get PrintWriter and ServletOutputStream both in a servlet?
How are filters?
What are some advantages of storing session state in cookies?
What is Request Dispatcher?
how the HTML data stored in web server?