<s:iterator value="#request.users" var="u"> <!-- 判断该条评论的评论人是不是查看这篇评论的用户,来控制其是否具有删除权限 --> <s:if test="#u.user_id == #request.user.user_id" > <a href="deleteComment?&userBlog.user_id=${u.user_id }&user.user_id=${user.user_id}" class="reply-btn">删除</a> </s:if> <a href="#" class="reply-btn">回复</a> </div> </s:iterator>
注:一定要加“#request”。