Struts-like approach
The column tag provides 5 struts-like attributes that can be set to create a dynamic linke ( href, paramID, paramName, paramProperty, paramScope ). See the display:column documentation, and the struts documentation for a complete description of their usage, but basically:
href
the base URL used to construct the dynamic link
paramId
the name of the parameter that gets added to the URL specified above
paramName
name of the bean that contains the data we want to tack on the the URL (typically null, indicating the current object in the List)
paramProperty
property to call on the object specified above to return the value that gets tacked onto the URL.
paramScope
specific scope where the databean lives, typically null
Of these params, you typically would not use paramName and paramScope. Leaving each as null indicates that you want to use the object corresponding to the current row being processed.
1 2 3 4 5
| <display:table name="sessionScope.details">
<display:column property="id" title="ID" href="details.jsp" paramId="id" />
<display:column property="email" href="details.jsp" paramId="action" paramName="testparam" paramScope="request" />
<display:column property="status" href="details.jsp" paramId="id" paramProperty="id" />
</display:table> |
Partager