<profile:getProfile> Tag

The <profile:getProfile> tag retrieves the profile corresponding to the provided profile key and profile type. The tag has no enclosed body. The retrieved profile can be treated as a com.bea.p13n.usermgmt.profile.ProfileWrapper. Along with the profile key and profile, an explicit successor key and successor type can be specified, as specified by the profileType attribute. This successor will then be used, along with the retrieved profile, in subsequent invocations of the <profile:getProperty> tag to ensure property inheritance from the successor. If no successor is retrieved, standard ConfigurableEntity successor search patterns will apply to retrieved properties.

Syntax

<tagName attribute="value" />

Attributes

profileKey

Required (String) - A unique identifier that can be used to retrieve the profile which is sought. Example: "<%=username%>".

successorKey

Optional (String) - A unique identifier that can be used to retrieve the profile successor. Example: "<%=defaultGroup%>".

scope

Optional (String) - The HTTP scope of the retrieved profile. Pass "request" or "session" as the values. Defaults to session.

groupOnly

Optional (String) - Specifies to retrieve a group profile named by the profileKey, rather than a user profile. No successor will be retrieved when this value is true. Defaults to false.

profileId

Optional (String) - A variable name from which the retrieved profile is available for the duration of the JSP's page scope.

successorId

Optional (String) - A variable name from which the retrieved successor is available for the duration of the JSP's page scope.

result

Optional (String) - A variable name from which the result of the operation is available.

Possible values:

Example

<%@ page import="com.bea.p13n.usermgmt.servlets.jsp.taglib.UserManagementTagConstants" %> 
<%@ page import="com.bea.p13n.property.servlets.jsp.taglib.PropertySetTagConstants" %>
<% String pname = request.getUserPrincipal().getName(); %>
<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"); 
} 
%>

Related Topics

<profile:getProperty> Tag

<profile:getPropertyAsString> Tag