bboss标签库与jstl标签库功能对比
本文就bboss标签库与jstl标签库中的几个常用标签做个简单的对比:
逻辑标签和数据展示标签
1.导入的tld文件
使用bboss标签库,jsp头部需要导入:
<%@ taglib uri="/WEB-INF/pager-taglib.tld" prefix="pg"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%><%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<c:if test="${menuType eq 'item' or menuType eq 'module' or menuType eq 'subSystem'}"> do somthing.</c:if>
<pg:in actual="${menuType}" scope="item,module,subSystem"> do somthing.</pg:in>
<pg:true actual="${menuType eq 'item' or menuType eq 'module' or menuType eq 'subSystem'}"> do somthing.</pg:true>
<c:forEach var="subSys" items="${subSystems}"><fieldset><legend>${subSys.value.name}</legend><table><tr><td width="124" height="28" height="28" items="${subSys.value.localeNames}" varStatus="status">${name.key}:${name.value}${status.index != fn:length(subSys.value.localeNames)-1 ? "," : ""} </c:forEach></td></tr><tr><td width="124" height="28" name="code"><pg:list actual="${subSystems}"><fieldset><legend><pg:cell colName="name"/></legend><table><tr><td width="124" height="28" height="28" ><pg:mapkey />:<pg:cell /><pg:equal expression="{rowcount}-1" expressionValue="{rowid}"> ","</pg:equal> </pg:map></td></tr><tr><td width="124" height="28" name="code">rowid:遍历集合的当前行号(从0开始)offset :分页标签中当前页的第一条记录在总记录中所处的位置rowcount :总记录数pagesize :当前页或者当前列表获取到的记录数mapkey :map中当前记录的keycurrentcell:map中当前记录的值
<pg:list actual="${subSystems}"><pg:cell colName="name"/>//对象中的name属性<pg:cell colName="id"/>//对象中的id属性</pg:list>
<c:forEach var="subSys" items="${subSystems}">${subSys.value.name}${subSys.value.id}</c:forEach>
<pg:map actual="${publicItem.workspacecontentExtendAttribute}"><pg:mapkey /><pg:cell/></pg:map>
<c:forEach var="attribute" items="${publicItem.workspacecontentExtendAttribute}">${attribute.key}${attribute.value}</c:forEach>
<pg:map actual="${publicItem.localeHeadimgs}" ><pg:notequal expression="{rowid}" value="0">,</pg:notequal><pg:mapkey/>:<pg:cell/> </pg:map>
<c:forEach var="headimg" items="${publicItem.localeHeadimgs}" varStatus="status">${headimg.key}:${headimg.value}${status.index != fn:length(publicItem.localeHeadimgs)-1 ? "," : ""} </c:forEach>