View Single Post
  #2 (permalink)  
Old 07-30-2007, 05:48 AM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 882
kingmaker is on a distinguished road
Send a message via Yahoo to kingmaker
Default Re: Advantages of JSP over servlets

Hi Lavanya,

Java Server Pages (JSP) is basically Sun's answer to Microsoft's Active
Server Pages (ASP). They work in very similar ways. ASP allows for
VBScript, JScript, or PerlScript code to be placed in between sections
of HTML. JSP does the exact same thing only using Java as the language
of choice. Both ASP and JSP combine the design (HTML) and the code
(ASP
or JSP) in the same file.

Java Servlets are a Java equivalent of a CGI script. Like CGI it can
generate HTML, but it does not allow for HTML to live in "raw" form
within the program. Servlets can be used to process a set of
instructions and then return the values that were created by the
Servlet.

JSP also supports "Tag Libraries" These are simple tags that you embed
in your JSP, which execute java code that is stored in a separate
class. This allows you to keep your keep complex page logic
encapsulated in separate classes, while keeping your JSP pages "clean",
and free of java code. By doing this, you keep the page design in the
JSP, and the page logic elsewhere. This makes it easier to develop and
maintain your pages.

In addition to writing your own tag libraries, you can also obtain free
open-source tag libraries to perform various functions.

Hope informative,,
__________________
The KINGMAKER
Makes Every Thing Possible

Stuffs (My Blog)
Reply With Quote