Struts2 使用 <s:iterator> 标签迭代取值
----------------------sturts.xml<action name="FindAllusersAction" + i); user.setPassword("password" + i); list.add(user); } HttpServletRequest request = ServletActionContext.getRequest(); request.setAttribute("list", list); System.out.println(list); System.out.println(request); return "list"; }}------------------------<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%><%@ taglib uri="/struts-tags" prefix="s"%><%String path = request.getContextPath();String basePath = request.getScheme() + "://"+ request.getServerName() + ":" + request.getServerPort()+ path + "/";%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><body>欢迎<table align="center"><s:property value="users.username" /><form><s:iterator value="#request.list"><tr><td><s:property value="usersid" /></td><td><s:property value="username" /></td><td><s:property value="password" /></td></tr></s:iterator></form></table></body></html>--------------------