<jsp:getProperty>

The <jsp:getProperty> action adds the value of a bean property, converted to a String, to the response generated by the page. It supports the attributes described in Table 1-5.

Table 1-5. Attributes for <jsp:getProperty>

Name

Java type

Request-time value accepted

Description

name

String

no

Mandatory. The name assigned to a bean in one of the JSP scopes.

property

String

no

Mandatory. The name of the bean’s property to include in the page.

Example:

<jsp:getProperty name="clock" property="hours" />

Get JavaServer Pages Pocket Reference 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.