The Advantages of JSP

By: aathishankaran Emailed: 1700 times Printed: 2205 times    

Latest comments
By: rohit kumar - how this program is work
By: Kirti - Hi..thx for the hadoop in
By: Spijker - I have altered the code a
By: ali mohammed - why we use the java in ne
By: ali mohammed - why we use the java in ne
By: mizhelle - when I exported the data
By: raul - no output as well, i'm ge
By: Rajesh - thanx very much...
By: Suindu De - Suppose we are executing

The Advantages of JSP

JSP has a number of advantages over many of its alternatives. Here are a few of them.

Versus Active Server Pages (ASP)  

ASP is a competing technology from Microsoft. The advantages of JSP are twofold. First, the dynamic part is written in Java, not VBScript or another ASP-specific language, so it is more powerful and better suited to complex applications that require reusable components. Second, JSP is portable to other operating systems and Web servers; you aren’t locked into Windows

NT/2000 and IIS. You could make the same argument when comparing JSP to Cold Fusion; with JSP you can use Java and are not tied to a particular server product.  

Versus PHP

PHP is a free, open-source HTML-embedded scripting language that is somewhat similar to both ASP and JSP. The advantage of JSP is that the dynamic part is written in Java, which you probably already know

Listing a sample JSP page

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML>
<HEAD><TITLE>Welcome to Our Store</TITLE></HEAD>  
<BODY>  
<H1>Welcome to Our Store</H1>  
<SMALL>Welcome,  
<!-- User name is "New User" for first-time visitors -->  
<%= Utils.getUserNameFromCookie(request) %>  
To access your account settings, click  
<A HREF="Account-Settings.html">here.</A></SMALL>  
<P>  
Regular HTML for all the rest of the on-line store’s Web page.  
</BODY>  
</HTML>

Extensive API for networking, database access, distributed objects, and the like, whereas PHP requires learning an entirely new language.

Versus Pure Servlets

JSP doesn’t provide any capabilities that couldn’t in principle be accomplished with a servlet. In fact, JSP documents are automatically translated into servlets behind the scenes. But it is more convenient to write (and to modify!) regular HTML than to have a zillion println statements that generate the HTML. Plus, by separating the presentation from the content, you can put different people on different tasks: your Web page design experts can build the HTML using familiar tools and leave places for your servlet programmers to insert the dynamic content.

Versus Server-Side Includes (SSI)

 SSI is a widely supported technology for inserting externally defined pieces into a static Web page. JSP is better because you have a richer set of tools for building that external piece and have more options regarding the stage of the HTTP response at which the piece actually gets inserted. Besides, SSI is really intended only for simple inclusions, not for “real” programs that use form data, make database connections, and the like. 

Versus JavaScript

JavaScript, which is completely distinct from the Java programming language, is normally used to generate HTML dynamically on the client, building parts of the Web page as the browser loads the document. This is a useful capability but only handles situations where the dynamic information is based on the client’s environment. With the exception of cookies, the HTTP request data is not available to client-side JavaScript routines. And, since JavaScript lacks routines for network programming, JavaScript code on the client cannot access server-side resources like databases, catalogs, pricing information, and the like. JavaScript can also be used on the server, most notably on Netscape servers and as a scripting language for IIS. Java is far more powerful, flexible, reliable, and portable.

Versus Static HTML

 Regular HTML, of course, cannot contain dynamic information, so static HTML pages cannot be based upon user input or server-side data sources. JSP is so easy and convenient that it is quite reasonable to augment HTML pages that only benefit slightly by the insertion of dynamic data. Previously, the difficulty of using dynamic data precluded its use in all but the most valuable instances.


JSP Home | All JSP Tutorials | Latest JSP Tutorials

Sponsored Links

If this tutorial doesn't answer your question, or you have a specific question, just ask an expert here. Post your question to get a direct answer.



Bookmark and Share

Comments(1)


1. View Comment

help, i want to migrate my system (asp to jsp)
i have source code encrypt.asp ; how i write in jsp code ???
thanks

my encrypt.asp
--------------------------------------
function Encrypt(Plain)
retVal=""
for i=1 to len(Plain)
retVal=retVal+chr(asc(mid(Plain,i,1))+99)
next
encrypt=retVal
end function

function Decrypt(Encrypted)
retVal=""
for i=1 to len(Encrypted)
retVal=retVal+chr(asc(mid(Encrypted,i,1))-99)
next
Decrypt=retVal
end function


View Tutorial          By: gendull at 2007-02-25 21:03:20

Your name (required):


Your email(required, will not be shown to the public):


Your sites URL (optional):


Your comments:



More Tutorials by aathishankaran
Web Security Issues
The Web User's Perspective
Server-side plug-Ins
The best way to avoid security vulnerabilities with new server
JavaScript Security
Window Object
Working with Status Bar Messages
Retrieving a Portion of a String
Referencing Windows
Math Object
Frame Object
Document Object
Closing Windows
Built-in Object in Javascript
Textarea Object

More Tutorials in JSP
LifecycleException: service.getName(): "Catalina"; Protocol handler start failed: `java.net.BindException: Permission denied <null>:80
JSP Alert Example
JSP CheckBox Example
Uploading an Image to a Database using JSP
Uploading a file to a server using JSP
A JSP page that gets properties from a bean
The page Directive in JSP
The taglib, tag, include, attribute and the variable Directive in JSP
Declarations in JSP
Scriptlets and Expressions in JSP
Tag Libraries in JSP
The Request Object in JSP
The Response Object in JSP
The Out Object in JSP
The Session Object in JSP

More Latest News
Most Viewed Articles (in JSP )
JSP Example to connect to MS SQL database and retrieve records
What are the different scopes in JSP?
JSP Program for display Date
JSP CheckBox Example
Embedding java codes in jsp sciptlets
Declaring variable in JSP
The Advantages of JSP
Referencing Windows
Deploying an Individual JSP on Tomcat
Getting HTTP Request Headers in a JSP
Getting Started with JSP
The taglib, tag, include, attribute and the variable Directive in JSP
Scriptlets and Expressions in JSP
The Out Object in JSP
JSP Alert Example
Most Emailed Articles (in JSP)
What is JSP?
JSP pages in servlet
Declaring variable in JSP
A Servlet That Generates HTML
Simple HTML-Building Utilities
Retrieving a Portion of a String
JSP Example to connect to MS SQL database using Tomcat Connection Pool
The Application Object in JSP
Cookies using JSP or Java Bean
Click to Activate and Use this control
The JSP Program running first Time.
Scriptlets
Server Side Programming
Syntax For JSP Declaratives
Embedding java codes in jsp sciptlets