Generating Dynamic Content

You have seen a few of the JSP tags, such as comments and include directives. In this section, you will learn how to generate dynamic content, such as the days of the current month.

Handling Dates with Java Classes

Before you add the tags to the JSP, you might want to know about some Java classes used for handling dates. Table 2.3 shows some classes that you will require.

Table 2.3. Java Classes for Handling Dates
Java ClassDescription
java.util.DateRepresents a specific instance in time, with millisecond precision. Creating a new date without any arguments creates an instance representing the current time and date.
java.util.CalendarAn abstract class that performs date arithmetic and can also be used for extracting ...

Get Java Server Pages from scratch now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.