StringBean.java.
A simple bean that has a single String property
called message. Remember: since this (and many other server-side classes
in this chapter) is in the moreservlets package,
it must be placed in the moreservlets directory.
SaleEntry.java.
Simple bean to illustrate the various forms
of jsp:setProperty.
SaleEntry1.jsp.
Page that uses explicit scripting expressions to read request
parameters and put the values into the
SaleEntry
class.
SaleEntry2.jsp.
Page that uses the param attribute of
jsp:setProperty to get rid of the explict Java code
needed to read request
parameters and put the values into the
SaleEntry
class.
SaleEntry3.jsp.
Page that uses property="*" in
jsp:setProperty to further simplify the way to
read request parameters and put the values into the
SaleEntry
class.
AccessCountBean.java.
Simple bean to illustrate sharing beans through
use of the scope attribute of jsp:useBean
and the difference between conditional and unconditional uses
of jsp:setProperty.
ExampleTag.java.
Very simple JSP tag that just inserts a string
("Custom tag example...") into the output. Note: since this
(and other tag implementation classes
in this chapter) is in the moreservlets.tags package,
it must be placed in the tags
subdirectory of the moreservlets directory.
msajsp-taglib.tld.
The tag library descriptor file used for the various tags in
this chapter.
SimplePrimeTag.java.
Tag that generates a prime number of approximately 50 digits. Requires
the Primes class.
Primes.java.
A few utilities to generate a large random BigInteger
and to find the next prime number above a given BigInteger.
Note that this class is in the moreservlets package,
not moreservlets.tags.
PrimeTag.java.
Tag that generates an N-digit random prime (default N = 50).
Extends SimplePrimeTag, adding a length attribute
to set the size of the prime. The doStartTag
method of the parent class uses the len field
to determine the length of the prime.
HeadingTag.java.
Tag that generates an HTML heading with the specified background
color, foreground color, alignment, font, and font size.
All attributes except the background color are optional.
IfExample.jsp.
Page that uses the if tag three different ways. In the
first instance, a value of true is hardcoded for the condition.
In the second instance,
a parameter from the HTTP request is used for the condition,
and in the third case, a
random number is generated and compared to a fixed cutoff. The
tag and attribute information are given in
msajsp-taglib.tld.
Travel.java.
Top-level travel-processing servlet. This servlet sets up
the customer data as a bean, then forwards the request
to the airline booking page, the rental car reservation
page, the hotel page, the existing account modification
page, or the new account page.