Uh-oh, it looks like your Internet Explorer is out of date.

For a better shopping experience, please upgrade now.



by Gary Bollinger, Bharathi Natarajan
Learn to deliver dynamic content to Web pages using JavaServer Pages. The ideal introduction to this server-side scripting language, JSP: A Beginner's Guide first covers the building blocks, such as JSP syntax, scripting elements, implicit objects, and tag libraries. You'll then learn how to build solid JSP architectures, create real-world Web


Learn to deliver dynamic content to Web pages using JavaServer Pages. The ideal introduction to this server-side scripting language, JSP: A Beginner's Guide first covers the building blocks, such as JSP syntax, scripting elements, implicit objects, and tag libraries. You'll then learn how to build solid JSP architectures, create real-world Web applications, implement application security measures. and integrate a database into your JSP architecture. Get started working with JSP right away with this self-paced, step-by-step learning solution.

Product Details

McGraw-Hill Companies, The
Publication date:
Beginner's Guides Series
Product dimensions:
7.50(w) x 9.25(h) x 1.07(d)

Read an Excerpt

Excerpt from

Part 1: JSP Foundations

Module 1:Introduction to Internet Technologies

Common Platform HTML provides a simple way to program applications within the browser page itself, thereby transforming it from a single application into an application platform.

Ease of Application Installation, Deployment, and Training
Web applications require no installation beyond installation of the browser. (And these days, the browser is often bundled with the operating system.) The popularity of the Web browser has also achieved a kind of critical mass-so many applications use a browser that people understand and feel comfortable with the browser as their platform. People rarely need much training in the mechanics of using a Web browser.

The popularity of browser applications does not mean that users are completely happy with their limitations. Most recent developments in the browser and the Web server aim to overcome the limits of the basic Web technology. Although this book describes JavaServer Pages, a server technology, let us briefly address browser technologies.

Extending the Web Browser

In recent years, various vendors have spent great effort extending the capabilities of the browser as an application interface. This usually happened under the auspices of making browser pages "more dynamic." The most important of these client-side extensions have been these:
  • Helper applications
  • Browser plug-ins
  • JavaScript
  • VBScript
  • Dynamic HTML
  • Java applets
Helper Applications Browsers do not know how to handle most format types they encounter on the Web. This is partly because so many format types exist and partly because new format types keep appearing. Browsers compensate by launching other applications based on media format. For example, a browser may not handle Real Video files but can be configured to launch the Real Player application to handle a Real Video download.

The MIME standard that provides the basic scheme for HTTP request formatting also provides the basis for launching helper applications. The idea is that the browser passes MIME format types that it cannot handle to helper applications.

Recently, helper application functionality has tended to migrate into browser plug-ins. We discuss plug-ins next.

Browser Plug-Ins
Browser plug-ins seamlessly extend browser functionality so that they appear to be part of the browser itself. For example, Adobe Software provides a plug-in for viewing Adobe's Portable Document Format (PDF). Other plug-ins support audio and video formats. Real Networks, for example, has plug-ins to play RealAudio and RealVideo files directly in the browser. Dozens of such plug-in programs now exist for both Netscape and Internet Explorer. Such plug-ins are loaded into the browser's own address space for execution. Vendors deploy plug-ins in browsers as shared libraries.

Shared libraries are specially packaged units of code (usually written in C or C++) that can be loaded and executed in an application at runtime. On Microsoft Windows platforms, shared libraries use Microsoft's Dynamic Link Library (DLL) format that has a All file extension. On UNIX platforms, shared libraries use the Dynamic Shared Object (DSO) format that has a .so file extension.

Both helper applications and plug-ins suffer from the limitation that they are not general purpose programming languages. They provide one proprietary function and only that function. JavaScript, on the other hand, provides a truly flexible programming language for browsers.

JavaScript was the first general purpose, "dynamic" client-side scripting language for browsers. Netscape first delivered JavaScript in 1995 but called it LiveScript. (See Steenson's article, "JavaScript: Past, Present, and Future," athttp://home.netscape.com/computing/webbuilding/ studio/feature19981111-1.html.)

Netscape quickly renamed LiveScript to JavaScript, thereby confusing many people who had just started to hear about Java. The confusion was somewhat lessened by Sun, the developer of Java, when it issued a joint press release with Netscape that same year. The press release proclaimed Java and javaScript to be complementary but very different technologies. (See http : / / home.netscape.com/newsref/pr/newsrelease67.html.)

JavaScript provides a scripting language for creating user interface controls. In effect, JavaScript inserts code logic into the browser. It supports such effects as validation of user input and image swapping as the mouse cursor rolls over a spot on a Web page.

Microsoft almost immediately wrote its own version of JavaScript and called it JScript. Both Microsoft and Netscape supported a scripting language standard encompassing the core features of JavaScript and JScript and controlled by the European Computer Manufacturers Association (ECMA) standards organization. ECMA named this scripting language ECMAScript. (See http : / /www. ecma. ch/.) Despite the respective commitments by Microsoft and Netscape to the ECMAScript standard, they continue their separate, proprietary and divergent enhancements to JavaScript. This means heavy dependence on JavaScript often requires separate code bases for different browsers.

Alongside JavaScript, Microsoft also developed VBScript as an interpreted subset of its Visual Basic programming language. Microsoft developed VBScript specifically for use in Microsoft's Internet Explorer to support ActiveX controls. ActiveX is a proprietary Microsoft object-oriented software component model. Like JavaScript, VBScript requires interpreter support in the Web browser. Microsoft positions VBScript as an alternative to JavaScript for those programmers who already know Visual Basic. Only Microsoft's browser, Internet Explorer, and Microsoft's Web server, the Internet Information Service (IIS), support VBScript.

Dynamic HTML

Dynamic HTML (DHTML) supports multiple technologies such as JavaScript and Java, but it is most strongly identified with Cascading Style Sheets (CSS), a W3C specification. (See http: //www.w3 . org/TR/REC-CSS1.) Cascading Style Sheets help page developers separate presentation elements from content elements. For example, exact pixel layout, similar to page layout for books or magazines, requires Cascading Style Sheets. Cascading Style Sheets also support such page element traits as colors, font specifications, display layers, and page margins.

Dynamic HTML also provides access to a browser page's Document Object Model (DOM). DOM is the internal representation of the elements of a page, along with their attributes. Dynamic HTML supports runtime access to some of these elements and in some cases, enables runtime modifications. For example, suppose we have this page element:

...Both JavaScript and VBScript can dynamically set the color of this element. Here is the JavaScript:

...HTML has a low level of standardization. Microsoft added support for its proprietary technologies, ActiveX and VBScript, which Netscape does not support. Both Netscape and Internet Explorer support CSS, but to different degrees for different features. Both the event model and DOM for Internet Explorer and Netscape differ, making cross-platform use of DHTML quirky. (See http : / /www. dhtml zone. com/.)

Java Applets Java was announced by Sun Microsystems in February of 1995, the same year that Netscape announced JavaScript. (See Richard Morin's article "Oak and WebRunner" in Sun Expert Magazine, 1995, Vol. 6, No. 2. Also see http://java.sun.com/pr/1995/02/pr950201-Ol.html.) Its original name was Oak. Sun described Oak as a simplified derivative of C++ and described its features as including the following:

  • Dynamic linking of program functionality into a running application using a network download
  • Independence from any CPU platform
  • Guaranteed security from viruses
Oak was renamed Java by April of 1995. (See Chris Rose's article, "It's the World Wide Web, But Not as We Know It," in PowerPC News: Apt Data News Ltd, 1995, Issue Number 534, UG534-17. Also see http : / / j ava. sun. com/ pr/1995/04/pr950417-01.htm1.)

From that quiet beginning as Oak, Java has captured unprecedented mindshare among programmers. Initially, this popularity focused on the client side, especially Java applets.

The idea behind applets was to provide full-featured programming capabilities to browser applications without sacrificing security. Both Netscape and Microsoft licensed Java and integrated it into their respective browsers. Today, Sun provides a Java plug-in for both browser platforms. Special HTML tags invoke the plug-in to load applets into a Java virtual machine (JVM). This plug-in bridges the browser and an external JVM. The Sun Java plug-in removes developer dependence on the "out-of-the-box" versions of the Java Virtual MaclAne supported by browser vendors. This allows developers to remain current with the Java releases. For example, at this time you must use the Sun plug-in to run Java 2 applets in a browser....

Meet the Author

Gary Bollinger is Chief Product Architect and co-founder of Artesia Technologies. He is the author of several articles appearing in JavaPro and JavaReport magazines. He has several undergraduate and graduate degrees in literature, computer science, theology, and a Ph.D. in philosophy. He also has 15 years' professional experience programming RPC, CORBA, and J2EE architectures. He loves his dogs.

Bharathi Natarajan is a Lead Engineer at Artesia Technologies and has co-authored articles appearing in JavaPro and JavaReport magazines. He has an undergraduate degree and a graduate degree in computer science. He has 8 years' professional experience programming in C/C++, distributed programming, and J2EE architectures. 1-k also loves his dogs.

Customer Reviews

Average Review:

Post to your social network


Most Helpful Customer Reviews

See all customer reviews