JavaServer Pages, Second Edition

( 1 )


Since its inception in 1999, Enterprise Java has taken the Java programming community by storm—developers have realized its potential for building distributed applications. Today, JavaServer Pages (JSP) continues to harmonize how web designers and programmers create dynamicweb sites. JSP builds on the popular Java servlet technology and makes it easier to develop dynamic web applications—even if you're not a hard-core programmer.JavaServer Pages, 2nd Edition is completely revised and updated to cover the ...

See more details below
Available through our Marketplace sellers.
Other sellers (Paperback)
  • All (21) from $1.99   
  • New (4) from $12.79   
  • Used (17) from $1.99   
Sort by
Page 1 of 1
Showing All
Note: Marketplace items are not eligible for any coupons and promotions
Seller since 2008

Feedback rating:



New — never opened or used in original packaging.

Like New — packaging may have been opened. A "Like New" item is suitable to give as a gift.

Very Good — may have minor signs of wear on packaging but item works perfectly and has no damage.

Good — item is in good condition but packaging may have signs of shelf wear/aging or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Acceptable — item is in working order but may show signs of wear such as scratches or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Used — An item that has been opened and may show signs of wear. All specific defects should be noted in the Comments section associated with each item.

Refurbished — A used item that has been renewed or updated and verified to be in proper working condition. Not necessarily completed by the original manufacturer.


Ships from: Davison, MI

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
Seller since 2009

Feedback rating:


Condition: New
2002-08-15 Paperback Second Edition New 059600317X Ships Within 24 Hours. Tracking Number available for all USA orders. Excellent Customer Service. Upto 15 Days 100% Money Back ... Gurantee. Try Our Fast! ! ! ! Shipping With Tracking Number. Read more Show Less

Ships from: Bensalem, PA

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
Seller since 2005

Feedback rating:


Condition: New
2002 Paperback New Tracking provided on most orders.

Ships from: Grand Rapids, MI

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
Seller since 2008

Feedback rating:


Condition: New

Ships from: fallbrook, CA

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
Page 1 of 1
Showing All
Sort by
Sending request ...


Since its inception in 1999, Enterprise Java has taken the Java programming community by storm—developers have realized its potential for building distributed applications. Today, JavaServer Pages (JSP) continues to harmonize how web designers and programmers create dynamicweb sites. JSP builds on the popular Java servlet technology and makes it easier to develop dynamic web applications—even if you're not a hard-core programmer.JavaServer Pages, 2nd Edition is completely revised and updated to cover the substantial changes in the 1.2 version of the JSP specification, and also includes detailed coverage of the new JSP Standard Tag Library (JSTL)—an eagerly anticipated specification of a set of JSP elements for the tasks needed in most JSP applications. This book starts off by illustrating how JSP capitalizes on the power of Java servlets to create effective, portable web applications. It shows how to get started using the Apache Tomcat server, and provides detailed coverage of JSP syntax and features, error handling and debugging, authentication and personalization, and how to use JSTL for database access, XML processing, and internationalization.JavaServer Pages recognizes the different needs of the two groups of professionals who want to learn JSP: page authors interested in using JSP elements in web pages, and programmers concerned with learning the JSP API and using JSP effectively in an enterprise application. If you're in the latter group, this book also teaches you such advanced topics as integrating servlets and JavaBeans with JSP, using the popular Apache Struts MVC framework to illustrate how it's done. Finally, the author presents how to develop custom tag libraries, using realistic examples that you can use as a springboard for your own JSP libraries.

"This is a complete, comprehensive, and most of all, practical book. The author excels at sharing his vast expertise so web developers can make the most out of JavaServer Pages and related web technologies."—Pierre Delisle, JSP Standard Tag Library Specification Lead
Read More Show Less

Editorial Reviews

From Barnes & Noble
Our Review
JavaServer Pages is attracting two large audiences: web site developers who want a sophisticated, platform-independent solution for delivering dynamic content and hard-core programmers who need in-depth mastery of the JSP API. JavaServer Pages is an outstanding resource for both groups.

Author Hans Bergsten -- a contributor to the Apache Tomcat JSP/servlet reference implementations -- begins with an overview of JSP and servlets, showing how JSP addresses key problems that servlets leave untouched. He walks through configuring the Tomcat Server JSP environment on Apache, then introduces all the basics of JSP dynamic content development.

You'll review each element of JSP scripting, including implicit JSP objects, conditional processing, expressions, variables, and methods, and master error handling and debugging. Bergsten shows how to manage sessions and share data among JSP pages, requests, and users. He also offers thorough chapters on JSP-based database access, authentication, personalization, and internationalization.

Having thoroughly introduced JSP and its role in web development, Bergsten moves on to JSP's applications in J2EE enterprise development, including powerful techniques for creating your own JSP components. The book concludes with comprehensive references to the JSP API, elements, and syntax.

Read More Show Less

Product Details

  • ISBN-13: 9780596003173
  • Publisher: O'Reilly Media, Incorporated
  • Publication date: 8/11/2002
  • Edition description: Second Edition
  • Edition number: 2
  • Pages: 688
  • Product dimensions: 6.98 (w) x 9.32 (h) x 1.21 (d)

Meet the Author

Hans Bergsten is the founder of Gefion Software, a company focused on Java services and products based on the J2EE technlogies. Hans has been an active participant in the working groups for both the servlet and JSP specifications from the time they were formed. He also contributes to other related JCP specifications, such as JSP Standard Tag Libraries (JSTL), and helped get the development of the Apache Tomcat reference implementation for servlet and JSP started as one of the initial members of the Apache Jakarta Project Management Committee.

Read More Show Less

Read an Excerpt

Chapter 5: Generating Dynamic Content

JSP is all about generating dynamic content: content that differs based on user input, time of day, the state of an external system, or any other runtime conditions. JSP provides you with lots of tools for generating this content. In this book, you will learn about all of them--standard actions, custom actions, JavaBeans, and scripting elements. Before we do that, however, let's start with a few simple examples to get a feel for how the basic JSP elements work.

In this chapter, we develop a page for displaying the current date and time, and look at the JSP directive element and how to use JavaBeans in a JSP page along the way. Next, we look at how to process user input in your JSP pages and make sure it has the appropriate format. We also look at how you can convert special characters in the output, so they don't confuse the browser.

What Time Is It?

Recall from Chapter 3, JSP Overview, that a JSP page is just a regular HTML page with a few special elements. JSP pages should have the file extension .jsp, which tells the server that the page needs to be processed by the JSP container. Without this clue, the server is unable to distinguish a JSP page from any other type of file and sends it unprocessed to the browser.

When working with JSP pages, you really just need a regular text editor such as Notepad on Windows or Emacs on Unix. Appendix E, JSP Resource Reference, however, lists a number of tools that may make it easier for you, such as syntax-aware editors that color-code JSP and HTML elements. Some Interactive Development Environments (IDEs) include a small web container that allows you to easily execute and debug the page during development. There are also several web page authoring tools--the type of tools often used when developing regular HTML pages--that support JSP. I don't recommend that you use them initially; it's easier to learn how JSP works if you see the raw page elements before you use tools that hide them.

The first example JSP page, named date.jsp, is shown in Example 5-1.

Example 5-1: JSP Page Showing the Current Date and Time (date.jsp)...

...The date.jsp page displays the current date and time. We'll look at all the different pieces soon, but first let's run the example to see how it works. Assuming you have installed all book examples as described in Chapter 4, Setting Up the JSP Environment, first start the Tomcat server and load the http://localhost:8080/ora/ URL in a browser. You can then run Example 5-1 by clicking the "Current Date/Time example" link from the book examples main page, shown in Figure 5-1. You should see a result like the one shown in Figure 5-2.

Figure 5-1. JSP book examples main page

Figure 5-2. Current Date/Time JSP page example...

...Notice that the month seems to be off by one and the year is displayed as 100. That's because the java.util.Date class we use here numbers months from 0 to 11, so January is 0, February is 1, and so on, and it reports year as the current year minus 1900. That's just the way this example works. As you will see later, there are much better ways to display dates.

The page shown in Example 5-1 contains both regular HTML elements and JSP elements. The HTML elements are used as-is, defining the layout of the page. If you use the View Source function in your browser, you notice that none of the JSP elements are visible in the page source. That's because the JSP elements are processed by the server when the page is requested, and only the resulting output is sent to the browser. To see the unprocessed JSP page in a separate window, click on the source link for the date.jsp file in the book examples main page. The source link uses a special servlet to send the JSP page as-is to the browser instead of letting the server process it. This makes it easier for you to compare the source page and the processed result.

Let's look at each piece of Example 5-1 in detail.

Using JSP Directives

The first line in Example 5-1 is a JSP directive element. Directives are used to specify attributes of the page itself, primarily those that affect how the page is converted into a Java servlet. There are three JSP directives: page, include, and taglib. In this example, we're using only the page directive. We'll see the others later.

JSP pages typically start with a page directive that specifies the scripting language and the content type for the page...

Read More Show Less

Table of Contents

What’s in the Book;
Readers of the First Edition;
About the Examples;
Conventions Used in This Book;
How to Contact Us;
Acknowledgments for First Edition;
Acknowledgments for Second Edition;
JSP Application Basics;
Chapter 1: Introducing JavaServer Pages;
1.1 What Is JavaServer Pages?;
1.2 Why Use JSP?;
1.3 What You Need to Get Started;
Chapter 2: HTTP and Servlet Basics;
2.1 The HTTP Request/Response Model;
2.2 Servlets;
Chapter 3: JSP Overview;
3.1 The Problem with Servlets;
3.2 The Anatomy of a JSP Page;
3.3 JSP Processing;
3.4 JSP Application Design with MVC;
Chapter 4: Setting Up the JSP Environment;
4.1 Installing the Java Software Development Kit;
4.2 Installing the Tomcat Server;
4.3 Testing Tomcat;
4.4 Installing the Book Examples;
4.5 Example Web Application Overview;
JSP Application Development;
Chapter 5: Generating Dynamic Content;
5.1 Creating a JSP Page;
5.2 Installing a JSP Page;
5.3 Running a JSP Page;
5.4 Using JSP Directive Elements;
5.5 Using Template Text;
5.6 Using JSP Action Elements;
Chapter 6: Using JavaBeans Components in JSP Pages;
6.1 What Is a Bean?;
6.2 Declaring a Bean in a JSP Page;
6.3 Reading Bean Properties;
6.4 Setting Bean Properties;
Chapter 7: Using Custom Tag Libraries and the JSP Standard Tag Library;
7.1 What Is a Custom Tag Library?;
7.2 Installing a Custom Tag Library;
7.3 Declaring a Custom Tag Library;
7.4 Using Actions from a Tag Library;
Chapter 8: Processing Input and Output;
8.1 Reading Request Parameter Values;
8.2 Validating User Input;
8.3 Formatting HTML Output;
Chapter 9: Error Handling and Debugging;
9.1 Dealing with Syntax Errors;
9.2 Debugging a JSP Application;
9.3 Dealing with Runtime Errors;
Chapter 10: Sharing Data Between JSP Pages, Requests, and Users;
10.1 Passing Control and Data Between Pages;
10.2 Sharing Session and Application Data;
10.3 Online Shopping;
10.4 Memory Usage Considerations;
Chapter 11: Accessing a Database;
11.1 Accessing a Database from a JSP Page;
11.2 Validating Complex Input Without a Bean;
11.3 Using Transactions;
11.4 Application-Specific Database Actions;
Chapter 12: Authentication and Personalization;
12.1 Container-Provided Authentication;
12.2 Application-Controlled Authentication;
12.3 Other Security Concerns;
Chapter 13: Internationalization;
13.1 How Java Supports Internationalization and Localization;
13.2 Generating Localized Output;
13.3 A Brief History of Bits;
13.4 Handling Localized Input;
Chapter 14: Working with XML Data;
14.1 Generating an XML Response;
14.2 Transforming XML into HTML;
14.3 Transforming XML into a Device-Dependent Format;
14.4 Processing XML Data;
Chapter 15: Using Scripting Elements;
15.1 Using page Directive Scripting Attributes;
15.2 Implicit JSP Scripting Objects;
15.3 Using Scriptlets;
15.4 Using Expressions;
15.5 Using Declarations;
15.6 Mixing Action Elements and Scripting Elements;
15.7 Dealing with Scripting Syntax Errors;
Chapter 16: Bits and Pieces;
16.1 Buffering;
16.2 Including Page Fragments;
16.3 Mixing Client-Side and Server-Side Code;
16.4 Precompiling JSP Pages;
16.5 Preventing Caching of JSP Pages;
16.6 Writing JSP Pages as XML Documents;
16.7 How URIs Are Interpreted;
JSP in J2EE and JSP Component Development;
Chapter 17: Web Application Models;
17.1 The Java 2 Enterprise Edition Model;
17.2 The MVC Design Model;
17.3 Scalability;
Chapter 18: Combining JSP and Servlets;
18.1 Servlets, Filters, and Listeners;
18.2 Picking the Right Component Type for Each Task;
18.3 Initializing Shared Resources Using a Listener;
18.4 Access Control Using a Filter;
18.5 Centralized Request Processing Using a Servlet;
18.6 Using a Common JSP Error Page;
Chapter 19: Developing JavaBeans Components for JSP;
19.1 Beans as JSP Components;
19.2 JSP Bean Examples;
19.3 Unexpected <jsp:setProperty> Behavior;
Chapter 20: Developing Custom Tag Libraries;
20.1 Tag Extension Basics;
20.2 Developing a Simple Action;
20.3 Developing an Iterating Action;
20.4 Processing the Action Body;
20.5 Handling Exceptions;
20.6 The Tag-Handler Lifecycle and What It Means to You;
20.7 Creating the Tag Library Descriptor;
20.8 Packaging and Installing a Tag Library;
Chapter 21: Advanced Custom Tag Library Features;
21.1 Developing Cooperating Actions;
21.2 Validating Syntax;
21.3 Using a Listener in a Tag Library;
21.4 Dynamic Attribute Values and Types;
Chapter 22: Integrating Custom Code with JSTL;
22.1 Using the Expression Language in Custom Actions;
22.2 Setting and Using Configuration Variables;
22.3 Integrating Custom Conditional Actions;
22.4 Integrating Custom Iteration Actions;
22.5 Integrating Custom I18N Actions;
22.6 Integrating Custom Database Actions;
22.7 Using JSTL Tag Library Validators;
Chapter 23: Database Access Strategies;
23.1 JDBC Basics;
23.2 Using Connections and Connection Pools;
23.3 Making a Connection Pool Available to Application Components;
23.4 Using a Generic Database Bean;
23.5 Developing Application-Specific Database Components;
JSP Elements Reference;
Directive Elements;
Scripting Elements;
Action Elements;
Escape Characters;
JSTL Actions and API Reference;
JSTL Library URIs and Default Prefixes;
Core Library Actions;
Internationalization and Formatting Actions;
Database Access Actions;
XML Processing Actions;
Support and Utility Types;
Configuration Settings;
JSTL Expression Language Reference;
Data Types;
Expressions and Operators;
JSP API Reference;
Implicit Variables;
Other Servlet Types Accessible Through Implicit Variables;
Tag Handler Types;
Tag Library Validation Types;
Other JSP Types;
Book Example Custom Actions and API Reference;
Generic Custom Actions;
Generic Utility Classes;
Web Application Structure and Deployment Descriptor Reference;
Web Application File Structure;
Web Application Deployment Descriptor;
Creating a WAR File;

Read More Show Less

Customer Reviews

Average Rating 5
( 1 )
Rating Distribution

5 Star


4 Star


3 Star


2 Star


1 Star


Your Rating:

Your Name: Create a Pen Name or

Barnes & Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation


  • - By submitting a review, you grant to Barnes & and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Terms of Use.
  • - Barnes & reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing 1 Customer Reviews
  • Anonymous

    Posted September 27, 2002

    Best JSP Book I've Seen So Far

    I've been using Java for around 5 years, so I've seen my fair share of books. I just got started on server-side stuff, so naturally I bought a few books - 3 to be exact - on servlets and JSPs. I liked the short, terse CodeNotes reference that I bought, but the other 2 ... Man, half the time I didn't really understand what I was reading, and I have never seen so many errors in my life! Honestly, I didn't know if it was because the server-side was so confusing or if the authors and publishers (none were O'Reilly) just didn't care. Then I bought this book and I am once again a happy camper. Both the text and examples are clear, concise, useful, and error-free. I really like the way the author not only explains concepts, but tells me why it is important that I know them.

    Was this review helpful? Yes  No   Report this review
Sort by: Showing 1 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)