# <um:getUserNamesForGroup> Tag

The <um:getUsernamesForGroup> tag retrieves a String array that contains the usernames matching the provided search expression and correspond to members of the provided group. The search expression supports only the asterisk (*) wildcard character, and is case insensitive. As many asterisks as desired may be used in the search expression. This tag has no enclosed body.

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

searchExp

Optional (String) - The search expression to apply to the user name search. Defaults to " *". Example: "t*".

groupName

Required (String) - The name of the group whose matching members are sought. Example: "engineering".

userLimit

Optional (String, representing an int) - The maximum number of users to be returned from the search. (String which has a particular Integer.valueOf.) Defaults to 100. If user count exceeds userLimit, the length of the array in id is truncated to the length of userLimit. Example: "500".

id

Required (String) - A variable name to which the resultant user names are assigned. Example: "myUsers".

result

Optional (String) - The name of an Integer variable to which the result of the get usernames for group operation is assigned.

Possible values:

- Success: UserManagementTagConstants.USER_SEARCH_OK.
- General error: UserManagementTagConstants.USER_SEARCH_FAILED.

Note: The USER_SEARCH_FAILED value is returned only when a general error occurs while searching for the user, such as a database connection failure. If no user matches the search criteria, the result will not be equal to UserManagementTagConstants.USER_SEARCH_FAILED, but the length returned by the array in id will be zero.

## Example

This example shows shows how to use <um:getUsernamesForGroup> to retrieve and display usernames that match the provided search expression and correspond to members of the provided group.

    <um:getUsernamesForGroup groupName="engineering" userLimit="500" searchExp="t*" id="myUsers"/>
    <%System.out.println("I found " + myUsers.length + " users in my group.");%>

Related Topics

<um:getUserNames> Tag