Java Reference
In-Depth Information
Figure 3.4: The contact list in a Display Tag table
3.4
Parameterized Links
Let's return to Stripes. We'll add the View and Delete links next to each
contact in the last column of the table (Figure 3.5 , on the following
page).
Back on page 30 , we saw how to create links with <s:link> and how to
trigger an action bean's event handler with the beanclass= and event=
attributes. Now, the links in each row of the table views or deletes the
corresponding contact. How do we indicate the target contact for each
link? With parameters.
Adding Parameters to Links
Parameterized links are powerful because they provide additional infor-
mation that the action bean can then use. Stripes makes it easy to
add parameters to links: add a property on the action bean and an
<s:param> tag within <s:link> in the JSP. We can add as many param-
eters as we need; we indicate the name= and value= of each parameter
in the <s:param> tag. When the user clicks the link, Stripes binds
each parameter value to the corresponding property on the action bean
 
 
 
 
Search WWH ::




Custom Search