logic:iterate和bean:define标签的使用

作者在 2006-12-10 02:47:00 发布以下内容

<%@ page language="java" pageEncoding="UTF-8"%>

<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-template" prefix="template" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-nested" prefix="nested" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html locale="true">
  <head>
    <html:base />
   
    <title>result.jsp</title>

 <meta http-equiv="pragma" content="no-cache">
 <meta http-equiv="cache-control" content="no-cache">
 <meta http-equiv="expires" content="0">   
 <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
 <meta http-equiv="description" content="This is my page">
 <!--
 <link rel="stylesheet" type="text/css" href="styles.css">
 -->

  </head>
 
  <body>
  <form action="">
  <table>
  <logic:iterate id="element" indexId="index" name="items">
  <tr><td>key值:</td><td><bean:write name="element" property="key"/></td></tr>
  <bean:define id="objectValue" name="element" property="value"/>
    <tr><td>id:</td><td><bean:write name="objectValue" property="id"/></td></tr>
    <tr><td>name:</td><td><bean:write name="objectValue" property="name"/></td></tr>
    <tr><td>age:</td><td><bean:write name="objectValue" property="age"/></td></tr>
    <tr><td>&nbsp;</td><td>&nbsp;</td></tr>
</logic:iterate>
</table>
</form>
  </body>
</html:html>

默认分类 | 阅读 10664 次
文章评论,共0条
游客请输入验证码
文章分类
最新评论