I am using the struts 2 iterator
to print a ArrayList
(Details of a student) of string on the JSP
. As the number of details in the ArrayList
are more I thought of keeping a hyperlink to one of the fields so that whenever a user clicks on the name of any student, other details of the student should come. Like that click calling a action from where I can go to a Dao to get the other details of that student.
My problem is how can keep a hyperlink to the element in a iterator, even then how to pass the name to action?? Can anyone help me to solve this?
<table class="display" border="1">
<tr>
<th>Username</th>
<th>Role</th>
<th>Name</th>
<th>Surname</th>
<th>Contact number</th>
<th>Email</th>
</tr>
<s:iterator value="list">
<tr>
<td><s:property value="userName"/></td>
<td><s:property value="role"/></td>
<td><s:property value="name"/></td>
<td><s:property value="initial"/></td>
<td><s:property value="contact"/></td>
<td><s:property value="email"/></td>
</tr>
</s:iterator>
lets say this prints __aadya__, __rolenum__, __name__, __surname__, __contact__, __email__
. when end-user clicks on username, he should be able to get the other details of aadya.