# <pref:forEachPreference> Tag

When you create a portlet with the WebLogic Workshop Portal Extensions Portlet Designer, you can add different preferences to it that help control the portlet's content and behavior (choose Insert-->New Preference). The portlet preferences JSP tags let you expose those preferences to end users, letting them view and set preferences.

The <pref:forEachPreference> tag loops over all the preferences available for a portlet and stores the results in an array of String objects.

## Syntax

<tagName attribute="value" />

## Attributes

nameVar

Required (String) - Variable to assign the name of the preference to.

valueVar

Required (String) - Variable to assign the value of the preference to.

## Example

    <pref:forEachPreference nameVar="name" valueVar="values">
        <tr>
            <td><%=name%></td>
            <td>
                <!-- Use the es:forEachInArray tag to iterate over the values -->
                <es:forEachInArray id="prefVal" array="<%=values%>" type="String">
                <%= prefVal %>
                </es:forEachInArray>
            </td>
        </tr>
    </pref:forEachPreference>

The Portal Samples contain examples of portlet preference JSP tags. In the Sample Portal, the RSS RSS News Feed Portlet uses the JSP tags, and the Tutorial Portal contains a Portlet Preferences page.

Related Topics

<pref:ifModifiable> Tag

<pref:else> Tag

<pref:getPreference> Tag

<pref:getPreferences> Tag

<es:forEachInArray> Tag