<profile:getPropertyAsString> Tag

The <profile:getPropertyAsString> tag retrieves the property value for a specified property set-property name pair. The tag has no enclosed body. The value returned is a String. In typical cases, this tag is used after the <profile:getProfile> tag is invoked to retrieve a profile for session use. The property to be retrieved is retrieved from the session profile. If the <profile:getProfile> tag has not been used upon invoking the <profile:getPropertyAsString> tag, the specified property value is retrieved from the Anonymous User Profile.

Note: All User Management tags send results to the same file. If you are checking for results, include this import statement at the top of the page: <%@ page import="com.bea.p13n.usermgmt. servlets.jsp.tags.UserManagementTag- Constants" %>

Syntax

<tagName attribute="value" />

Attributes

propertySet

Optional (String) - The Property Set from which the property's value is to be retrieved. Example: "Demographics". If no property set is provided, the property is retrieved from the profile's default (unscoped) properties.

propertyName

Required (String) - The name of the property to be retrieved. Example: "Date_of_Birth".

id

Optional (String) - If the id attribute is supplied, the value of the retrieved property will be available in the variable name to which id is assigned. Otherwise, the value of the property is inlined.

Example

This example shows how to retrieve a String of information from a user profile.

<profile:getPropertyAsString 
id="myBirthDate" 
propertySet="Demographics" 
propertyName="Date_of_Birth"/>My birthday is <%=myBirthDate%>.

This tag is used in the Portal Search portlet.

Related Topics

<profile:getProperty> Tag