日期:2014-05-16  浏览次数:20329 次

jsp中使用Iterator遍历action返回的对象时,怎么将对象属性的值赋给变量
jsp中使用Iterator遍历action返回的对象时,怎么将对象属性的值赋给变量

--------------------------showTree.jsp


<%@ page language="java" contentType="text/html; charset=UTF-8"
	import="java.util.*,com.qiyi.po.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	</head>
	<body><a href="./findAllAction.action">显示</a>
	<table align="left" border="2" bordercolor="ffffff">
	 <s:form>
	 <tr>
           <td> 
           <%
           List<Tree> list=(List<Tree>)request.getAttribute("list");
           for(Tree t:list){
           for(int i=0; i<t.getPid(); i++){
            %>  
            <%="&nbsp;&nbsp;"%>
           <%}%> 
           <%=t%><br>
           <%}%>  
         </td>
      </tr>
      </s:form>
     </table>
	</body>
</html>