ITworld.com
  Search  
ITworld Home Page ITworld Webcasts ITworld White Papers ITworld Newsletters ITworld News ITworld Topics Careers ITworld Voices ITwhirled Changing the way you view IT
ASP vs. JSP
ASP TUTOR --- 07/02/2001

Due to popular request, I am devoting this issue to the basic differences between ASP and JSP. Many people have asked me which they should use in different situations. In some cases, the choice between them is pretty cut and dry. In others, it is not so simple. 

On this topic

An ASP file, as you know, is an HTML file embedded with server-side script that is usually written in a form of Visual Basic called VBScript. I say "usually" because there is an option for using server- side JavaScript. The JavaScript option is rarely since VBScript is the default server-side language for IIS servers and is much more widely supported than JavaScript on IIS.

A JSP page is an HTML file embedded with server-side script that is always written in Java. This is not a "scripting" version of Java, but a full implementation of Java plus a few calls and tags specific to managing HTTP protocols and HTML environments.

The hard separation between the two is that ASP is Microsoft's solution and JSP is Sun's. JSP is not supported directly on IIS. ASP is not directly supported anywhere that implements a non-Microsoft server solution.

A few third party add-ons provide full JSP support in an IIS environment. The leading third party products are JRun and ServletExec. These products install themselves as ISAPI filters, intercepting requests for JSP pages and passing them off to a Java Virtual Machine (JVM) for processing.

Unfortunately, if you wish to run both ASP and JSP on the same IIS server using one of these add-ons, JSP performance will suffer. Microsoft's ASP processor takes priority over the background JVM. Also, JSP and ASP run in different memory spaces, so the two environments maintain their own session objects. Session cannot be shared between the two.

If your server platform is already selected, the choice between JSP and ASP is simple. For Microsoft server implementations, use ASP. For others, use JSP.

The selection of an appropriate platform is well beyond the scope of this newsletter, but let's assume that you've yet to make that decision and the features of the development tools are a big part of that decision. In this case, the choice between JSP and ASP becomes much more complex.

By now, you are familiar with how ASP pages are processed. JSP pages follow a very different path. When the server receives a JSP page request, the timestamp of the page is compared against a cached, compiled, version of the file. If the compiled version is out of date, it is immediately recompiled. The Java servlet engine then loads the up- to-date compiled version. (All JSP pages are compiled into Java servlets).

Once the JSP's servlet is loaded, all subsequent calls use the cached, compiled version. The optimal use of caching makes JSP response great for large memory servers.

JSP pages have full access to Java classes, beans, and Enterprise Java Beans (EJBs). ASP pages use ActiveX components, COM, and DCOM. Neither support the other's interfaces. If you have a third-party vendor providing ActiveX components as their interface, ASP is the best option.

Overall, new JSP development takes longer than ASP development and requires a more expensive staff. On the other hand, long-term maintenance of a well-designed JSP site should require less time and resources.

JSP does have some design issues that separate it from ASP. For example, in ASP I can embed HTML in a function so that I can call it several times form the page. In JSP, this just doesn't work. You must put your entire HTML inside an out.write() call. What this means, long- term, is that you must engage a developer to make simple content changes.

I have developed large, high-volume web sites in both JSP and ASP. I have had great success using both. I also had a good time developing in both platforms.

The ASP implementations were driven by the necessity of using IIS. The design and development cycles were quick and required a mid-range development staff. The JSP implementations contained fewer pages, took longer to design and develop, and required a much more experienced development team. In long-term maintenance costs, though, JSP seems to win out. This may be related to the server platform (UNIX-based), more than the development tools. As a side note, the cost of the hardware platforms to fully support a high-volume site tends to be higher for JSP implementations than for ASP.

In summary, ASP provides a less expensive, faster implementation than JSP. A well-designed JSP application may provide longer-term cost savings.

 





Advertisements
Sponsored links
Locate Hidden Software on business PCs with this free tool
KODAK i1400 Series Scanners stand up to the challenge
Top 5 Reasons to Combine App Performance and Security
Bring harmony to your mix of UNIX-Linux-Windows computing environments
 Home   Newsletters  ASP TUTOR
www.itworld.com    open.itworld.com     security.itworld.com     smallbusiness.itworld.com
storage.itworld.com     utilitycomputing.itworld.com     wireless.itworld.com

 
Contact Us   About Us   Privacy Policy    Terms of Service   Reprints  

CIO   Computerworld   CSO   GamePro   Games.net   Industry Standard   Infoworld   ITworld  
JavaWorld   LinuxWorld  MacUser   Macworld   Network World   PC World   Playlist  

DEMO   IDG Connect   IDG Knowledge Hub   IDG TechNetwork   IDG World Expo  

Copyright © Computerworld, Inc. All rights reserved

Reproduction in whole or in part in any form or medium without express written permission of Computerworld Inc. is prohibited. Computerworld and Computerworld.com and the respective logos are trademarks of International Data Group Inc.