JS脚本
<script type="text/javascript">
function modify(id)
{
location.replace("<%=basePath%><s:url value='stu_tomodify?id='/>"+id);
}
function add()
{
location.replace("<%=basePath%><s:url value='stu_toadd'/>");
}
</script>
JSP页面
<s:iterator value="stuList.datas" var="stu" status="index">
<tr
onmouseover="this.style.backgroundColor='#DBE4FF';this.style.cursor='hand'"
onmouseout="this.style.backgroundColor='#ffffff';this.style.cursor='default'"
ondblclick="modify(<s:property value="#stu.stuId"/>)">
<td>
<s:checkbox name="stuids" fieldValue="%{#stu.stuId}" />
</td>
<td>
<s:property value="#stu.stuId" />
</td>
<td>
<s:property value="#stu.stuName" />
</td>
<td>
<s:if test="#stu.stuSex==1">男</s:if>
<s:else>女</s:else>
</td>
<td>
<s:property value="#stu.stuAge" />
</td>
<td>
<s:date name="#stu.stuBirth" format="yyyy年MM月dd日" />
</td>
<td>
<s:property value="#stu.classes.className" />
</td>
<td>
<s:if test="#stu.stuStatus==1">在职</s:if>
<s:else>离职</s:else>
</td>
<td>
<a href='stu_todel?id=<s:property value="#stu.stuId" />'>删除</a> // 普通方式
</td>
</tr>
</s:iterator>