zl程序教程

您现在的位置是:首页 >  其它

当前栏目

<s:iterator标签使用

标签 lt Iterator 使用
2023-09-14 08:59:40 时间
%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%  
%@ taglib prefix="s" uri="/struts-tags" %  

String path = request.getContextPath(); 
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 
%  

!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"  
html  
  head  
    base href=" %=basePath% "  
    
    title My JSP result.jsp starting page /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  
  table align="center" width="40%" border="1"  
  tr  
   td id 
   /td  
   
   td username 
   /td  
   
   td password 
   /td  
   
   td userId 
   /td  
   /tr  
  s:iterator value="#request.list" id="us"  
   tr  
   td s:property value="#us.id"/  
   /td  
   
   td s:property value="#us.username"/  
   /td  
   
   td s:property value="#us.password"/  
   /td  
   
   td s:property value="#us.userId"/  
   /td  
   /tr  
   /s:iterator  
   /table  

username:${user.username} %= request.getAttribute("username") % br  
password:${user.password} %= request.getAttribute("password") % br  



  /body  
/html