您的位置:首页 > 编程语言

一些常用的代码

2010-05-23 11:30 295 查看
<c:if test="${empty currAccount}" var="flag"><a href="${ctx}/login.jsp">登录</a>  |  </c:if>

<c:if test="${!flag}"><a href="${ctx}/account.do?method=logout">注销</a>  |   </c:if>







<div id="searchBar">

<form id="searchForm" name="searchForm" action="${ctx}/forumupload.do?method=search" method="post">文件搜索:  

<input type="text" name="keyword" size="40" maxlength="50" value="${param.keyword}"/>  

<input type="submit" value="查询"/>    <a href="#">高级搜索</a>

</form>

</div>







<div class="longBar">

<div class="longTitle">搜索结果:搜索关键字【${lsr.keyword}】,共搜索到【${lsr.recordCount }】个产品,耗时:${lsr.time}秒,当前显示${lsr.stratNo}—${lsr.endNo}记录</div>

<div class="longBody">

<form action="${ctx}/account.do?method=login" method="post" onsubmit="return submitForm();">

<table width="100%" border="0" cellspacing="5" cellpadding="5">

<c:forEach items="${lsr.datas}" var="prod">

<tr>

<td>

产品名: <a href="${ctx}/prod.do?method=findById&id=${prod.id}">${prod.name}</a><br/>

产品描述:${prod.description}<br/>

出产日期: ${prod.pubDate }<br/><hr/>

</td>

</tr>

</c:forEach>

</table>

</form>

</div>





<c:choose>
<c:when test="${fn:length(Article.summary)<=20}">
${Article.summary }
</c:when>
<c:otherwise>
${fn:substring(Article.summary,0,20)}……
</c:otherwise>
</c:choose>





以下输出为:列表所有权限,当前角色拥有的角色选中



<c:if test="${!empty pm}">

<c:forEach items="${pm}" var="permissions" varStatus="vs">

<c:set var="isEmpty" value="false" />

<c:if test="${!empty cPermissionss}">

<c:forEach items="${cPermissionss}" var="cPer">

<c:choose>

<c:when test="${permissions.per_id==cPer.per_id}">

<c:set var="isEmpty" value="true" />

</c:when>

</c:choose>

</c:forEach>

<c:choose>

<c:when test="${isEmpty==true}">

<tr id="" class="sep${vs.index%2==0?1:2}">

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

<input type="checkbox" onclick="myAuthorized();" id="perId" name="permissions.per_id" value="${permissions.per_id}" checked="checked" />

</td>

<td style="text-align: center">${vs.count }</td>

<td>${permissions.per_name}</td>

<td style="text-align: center">${permissions.per_description}</td>

</tr>

</c:when>

<c:otherwise>

<tr id="" class="sep${vs.index%2==0?1:2}">

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

<input type="checkbox" onclick="myAuthorized();" id="perId" name="permissions.per_id" value="${permissions.per_id}"/>

</td>

<td style="text-align: center">${vs.count }</td>

<td>${permissions.per_name}</td>

<td style="text-align: center">${permissions.per_description}</td>

</tr>

</c:otherwise>

</c:choose>

</c:if>



<c:if test="${empty cPermissionss}">

<tr id="" class="sep${vs.index%2==0?1:2}">

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

<input type="checkbox" onclick="myAuthorized();" id="perId" name="permissions.per_id" value="${permissions.per_id}"/>

</td>

<td style="text-align: center">${vs.count }</td>

<td>${permissions.per_name}</td>

<td style="text-align: center">${permissions.per_description}</td>

</tr>

</c:if>

</c:forEach>

</c:if>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: