# jsp:getProperty Tag

The <jsp:getProperty> tag gets a bean property value using the property's getter methods and inserts the value into the response. You must create or locate a bean with <jsp:useBean> before you use <jsp:getProperty>. The <jsp:getProperty> tag has a few limitations:

- You cannot use <jsp:getProperty> to retrieve the values of an indexed property.
- You can use <jsp:getProperty> with JavaBeans components, but not with Enterprise JavaBeans. As alternatives, you can write a JSP page that retrieves values from a bean that in turn retrieves values from an enterprise bean, or you can write a custom tag that retrieves values from an enterprise bean directly.

For more information, see the JavaServer Pages (JSP) v1.2 Syntax Reference on the Sun Microsystems® web site.

## Syntax

<jsp:getProperty name="beanInstanceName" property="propertyName" />

## Attributes

name="beanInstanceName"

The name of an object (usually an instance of a bean) as declared in a jsp:usebean tag.

property="propertyName"

The name of the bean property whose value you want to display. The property is declared as a variable in a bean and must have a corresponding getter method (for more information on declaring variables and writing getter methods in beans, see http://java.sun.com/products/javabeans/docs/).

## Examples

    <jsp:useBean id="calendar" scope="page" class="employee.Calendar" />
    <h2>
    Calendar of <jsp:getProperty name="calendar" property="username" />
    </h2>

Related Topics

jsp:fallback Tag

jsp:forward Tag

jsp:include Tag

jsp:param Tag

jsp:params Tag

jsp:plugin Tag

jsp:setProperty Tag

jsp:useBean Tag

JSP Tag Reference for Page Flows