struts1标签循环里面的判断

<%@ page language="java" contentType="text/html; charset=GBK" import="java.util.*, java.text.*" pageEncoding="GBK"%>
<%@include file="/commons/taglibs.jsp"%>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@taglib uri="/WEB-INF/tag.tld" prefix="tag"%>
<%@include file="/ui/jsp/initJs.jsp"%>
<%@include file="/ui/jsp/initCss.jsp"%>
<%@page import="com.post.util.Utils"%>


<base href="<%=basePath%>">
<html>
<head>
<tag:res path="/js/calendar/WdatePicker.js" attr="defer='defer'"></tag:res>
<tag:res path="/js/Check.js"></tag:res>
<tag:res path="/js/jquery.js"></tag:res>
<script language=javascript type="text/javascript">
var $j = jQuery.noConflict();
</script>

<tag:res path="/mgnt/StateBatchDemand/css.css"></tag:res>
<title>客户对账</title>
<script language="javascript" type="text/javascript">

function getForm(){
return BasicForm;
}

//导入邮件text表
function click_imp(){
var textFile=document.all("textFile").value;
//alert(textFile); //文件的路径名称
document.all('filePath').value=textFile;
// 若取不到绝对路径在浏览器设置:工具 -> Internet选项 -> 安全 -> 自定义级别 -> 找到“其他”中的“将本地文件上载至服务器时包含本地目录路径”,选中“启用”即可。
if(null == textFile || '' == textFile){
alert('请要导入的txt文件!')
return;
}
else{
BasicForm.submit();
}
}


function downLoad(url){
var a=url.indexOf('filePath');
var b=url.length;
var c=url.substring(a+9, b);
if(c.length>0){ //表示有路径
var form=getForm();
form.action = url;
}else{
alert("查询的文件未生成,不能下载");
}
}

function cancelQuery(url){
var form=getForm();
var b=url.length;
form.action = url;
form.submit();
}

//下载文件
function downFile(url){
var a=url.indexOf('filePath');
var b=url.length;
var c=url.substring(a+9, b);
if(c.length>0){
window.location.href=url;
}else{
alert("查询的文件未生成,不能下载");
}

}


function cls(a){
alert(a);


}



</script>
</head>
<body class="nobg">

<html:form action='mail/mgnt/CustQuery.do?method=list' method="post">
<input type="hidden" id="filePath" name="filePath"/>
<div class="wrap0">
<div class="left">
<label>选择要导入的邮件号文件<font color="red" >*</font></label>
<input type="file" size="14" name="textFile" id="textFile"/>
<div class="buttons">
<button class="positive" name="qry" onClick="javascript:click_imp()">
<img src="ui/images/search.gif" alt=""/>导入
</button>
</div>
</div>
<!-- 列表部分开始 -->
<table border="0" cellspacing="0" cellpadding="0" class="detail state" id="showTable">
<thead>
<tr>
<th>查询批次</th>
<th>查询时间</th>
<th>邮件数(个)</th>
<th>查询进度</th>
<th>查询结果</th>
<th>取消</th>
</tr>
</thead>
<tbody>
<%int k=1; %>
<logic:present name="volist">
<bean:define id="list" name="volist"/>
<logic:empty name="list">
<tr>
<td colspan="6">当前查询的结果为空,请重新查询!</td>
</tr>
</logic:empty>
<logic:iterate id="li" name="list">
<bean:define id="ub" name="li" type="Map"/>


<%k+=1; %>
<tr>
<td style="text-align: center;">
<bean:write name="ub" property="REQ_CODE" />  
</td>

<td style="text-align: center;">
<bean:write name="ub" property="REQ_TIME" />  
</td>


<td style="text-align: center;">
<bean:write name="ub" property="AL_MAIL" />  
</td>

<td style="text-align: center;">

<bean:write name="ub" property="PC" />  

</td>
<td style="text-align: center;">

[b] [i]<!--此处判断 list里的一个字段属性是否等于一个常量。。。。。。。。-->[/i][/b]
<logic:equal name="ub" property="IS_PATH" value="1">
<input type="button" οnclick="downLoad('<%=request.getContextPath()%>/mail/mgnt/CustQuery.do?method=downLoadResult&filePath=<bean:write name="ub" property="FILE_PATH" />')" value="下载">
</logic:equal>


</td>
<td style="text-align: center;">
<button class="positive" name="qry" οnclick="cancelQuery('<%=request.getContextPath()%>/mail/mgnt/CustQuery.do?method=cancelQuery&reqCode=<bean:write name="ub" property="REQ_CODE" />')">
<img src="images/y_ico_hidden.gif" alt=""/>取消
</button>
</td>
</tr>
</logic:iterate>
</logic:present>
</tbody>
<!-- 字段内容部分结束 -->
</table>
<iframe id="myframe" src="" frameborder="0" scrolling="0" name="detail" style="display: none;width: 800px;height: 460px;"></iframe>
</div>
</html:form>
</body>
</html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值