`
张玉龙
  • 浏览: 726277 次
  • 性别: Icon_minigender_1
  • 来自: 沈阳
社区版块
存档分类
最新评论

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>










分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics