如何检查JSTL中的两个字符串?
是<c:if test="${dtmplOnlyCategory == dtmplDetails }">
还是<c:if test="${dtmplOnlyCategory} == ${dtmplDetails }">
。我想检查两个字符串是否相等如果相等我有逻辑继续
<c:if test="${not empty DTmpl}">
<div class="tmpcntr">
<%=onl_cat %>
<c:forEach var="dtmplOnlyCategory" items="${onl_cat}" varStatus="indexMap">
<div><c:out value="${dtmplOnlyCategory }"/><br></div>
<c:forEach var="dtmplDetails" items="${DTmpl}" varStatus="indexMap">
<c:if test="${dtmplOnlyCategory}">
<c:set var="tmplName" value="${dtmplDetails.tmplName}"/>
<div class="thumbcntr" onclick="showTemplatePreview('<c:out value="${tmplId}"/>','DT','template');">
<img src="<c:out value='${imgPath}'/>/images/<c:out value="${tmplName}"/>.gif" alt="<c:out value="${tmplName}"/>">
<div class="tmpnme"><c:out value="${tmplName}"/></div>
</div>
</c:if>
</c:forEach>
</c:forEach >
</div>
</c:if>
答案 0 :(得分:1)
<c:if test="${dtmplOnlyCategory == dtmplDetails}">
是使用