Home Start Back Next End
  
58
which
is similar to HTML
files and
if
you
want to
insert java code, you simply enclosed
in by using “<%” and end with “%>”. For example, here is a section of a JSP page that
results
in “Thank
you Raymond”.
Thank you <%= request.getParameter(“name”) %>
2.3.10 JSP versus Servlet
According to Marty [1], JSP does not provide any capabilities that could not, in
principle, be accomplished with a servlet. In fact, JSP documents are
automatically
translated
into
servlets
behind
the
scenes.
It
is
more
convenient
to
write
regular
HTML
than to have a million of
println statement that generates HTML. JSP developers need to
know servlets for 4 reasons:
1. 
JSP pages are translated into servlets. You can not understand how JSP works
without understanding servlet.
2.   JSP
consists
of
static
HTML,
special-purpose
JSP
tags,
and
Java
code,
which
is
Servlet code.
3. 
Some tasks are better accomplished by servlets than by JSP. JSP is good at
generating pages that consists of large sections of fairly well structured HTML or
other character data. Servlets are better
for
generating binary data, building pages
with  highly  variable  structure,  and  performing  tasks  that  involve  little  or  no
output.
4.   Some tasks are better accomplished by a combination of servlets and JSP than bye
either servlets or JSP alone.
Word to PDF Converter | Word to HTML Converter