...
Code Block |
---|
<!-- Spring form tag will cause duplicate ids -->
<form:select path="title" items="${titles}" />
<!-- when rendered might look something like this -->
<select id="title" name="title">
<option value="Mr">Mr</option>
<option value="Mrs">Mrs</option>
<option value="Miss">Miss</option>
</select>
<!-- Instead specify a namespaced id -->
<c:set var="n"><portlet:namespace /></c:set>
<form:select id="${n}title" path="title" items="${titles}" />
|
defineObjects tag
The defineObjects tag creates a number of useful variables that the JSP page can use.
Code Block |
---|
<portlet:defineObjects/>
<!-- Page can now access user preferences and other items. -->
<p>Hello ${portletPreferencesValues['prefName'][0]}</p> |
Info |
---|
icon | false |
---|
title | Additional References |
---|
|
JavaScript Best Practices |