# <um:getProfile> Tag

The <um: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 <um:getProperty> tag to ensure property inheritance from the successor. If no successor is retrieved, standard ConfigurableEntity successor search patterns will apply to retrieved properties.

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

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:

- Success: UserManagementTagConstants.GET_PROFILE_OK.
- Error encountered:
  - UserManagementTagConstants.GET_PROFILE_FAILED.
  - UserManagementTagConstants.NO_SUCH_PROFILE.
  - UserManagementTagConstants.NO_SUCH_SUCCESSOR.

## Example1

This example shows a profile being retrieved with no successor specified and an explicitly-supplied session scope.

    <um:getProfile profileKey="bob" profileType="AcmeUser" profileId="myProfile" scope="session"/>

## Example 2

This example shows a default user profile type being retrieved with a default successor type and an explicitly-supplied request scope.

    <um:getProfile profileKey="bob" successorKey="engineering" scope="request"/>

Related Topics

<um:getProperty> Tag

<um:getPropertyAsString> Tag