The <profile:getProperty> tag retrieves the property value for a specified property set-property name pair. The tag has no enclosed body. The value returned is an Object. 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:getProperty> 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" %>
<tagName attribute="value" />
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.
<%@ page import="com.bea.p13n.usermgmt.servlets.jsp.taglib.UserManagementTagConstants" %> <%@ page import="com.bea.p13n.property.servlets.jsp.taglib.PropertySetTagConstants" %>
<% String pname = request.getPrincipalName(); %> <profile:getProfile profileKey="<%=pname%>" result="rc"/>
<% if (rc.intValue() == UserManagementTagConstants.GET_PROFILE_OK) out.println("GET_PROFILE_OK"); else if (rc.intValue() == UserManagementTagConstants.GET_PROFILE_FAILED) out.println("GET_PROFILE_FAILED"); else if (rc.intValue()==UserManagementTagConstants.NO_SUCH_PROFILE) out.println("NO_SUCH_PROFILE"); %>
<profile:getProperty propertySet="ldap" propertyName="cn" id="myProperty" /> <% if (myProperty.toString().equalsIgnoreCase("roy hobbs")) { out.println(myProperty); } else { out.println(myProperty + " failed here"); } %>