Skip to Content
Beginning JavaServer Pages™
book

Beginning JavaServer Pages™

by Vivek Chopra, Sing Li, Rupert Jones, John T. Bell, Jon Eaves
February 2005
Intermediate to advanced
1296 pages
29h 21m
English
Wrox
Content preview from Beginning JavaServer Pages™

Chapter 2. JSP Basics 1: Dynamic Page Creation for Data Presentation

Many of the most popular Web sites in the world are running JSP technology. JSP enables the flexible and dynamic creation of Web pages. For example, in an online community, JSP may be used to create highly personalized pages containing only information that is relevant to a community member. As another example, an online store could use JSP to dynamically create a checkout form with the products in a customer's shopping cart. The possibilities are limited only by the designer's imagination.

This chapter formally introduces the components that make up a JSP page, and thoroughly explores the role of JSP as a dynamic Web page creation technology.

This chapter covers the following topics:

  • The anatomy of a typical JSP page

  • Processing HTML forms with JSP

  • Incorporating the output of JSP fragments

  • Creating a JSP that generates different HTML depending on input

  • Using JSP to create a personalized Web site

Three hands-on examples are presented in this chapter. They introduce new concepts and techniques in JSP programming.

The Anatomy of a JSP Page

Figure 2-1 shows a typical JSP page, with all of its visible elements explicitly labeled.

Anatomy of a JSP page

Figure 2.1. Anatomy of a JSP page

The visible elements that make up a JSP page can include the following:

  • Directive elements

  • Template data

  • Action

  • Scripting elements

A JSP page does not need to have all of these ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

JavaServer Faces

JavaServer Faces

Hans Bergsten
Core JavaServer Faces, Second Edition

Core JavaServer Faces, Second Edition

David Geary, Cay Horstmann

Publisher Resources

ISBN: 9780764574856Purchase book