Java JSP-按价格排序
我有8个产品在两行(每行4个),我想让它排序按较高的价格到较低的,所以它看起来较高的价格产品首先和较低的价格产品最后。我如何才能实现它?请代码示例 (div class=“可折叠”>Java JSP-按价格排序,java,html,sorting,product,Java,Html,Sorting,Product,我有8个产品在两行(每行4个),我想让它排序按较高的价格到较低的,所以它看起来较高的价格产品首先和较低的价格产品最后。我如何才能实现它?请代码示例 (div class=“可折叠”> ${store.currency.htmlSymbol}免费 ${store.currency.htmlSymbol}${release.productPrices[store.id].price}${release.productPrices[storeId].price} 获取产品详细信息时,您可以使用o
${store.currency.htmlSymbol}免费
${store.currency.htmlSymbol}${release.productPrices[store.id].price}${release.productPrices[storeId].price}
获取产品详细信息时,您可以使用order by。好主意,让我试试这种方式,谢谢Butani。
<c:forEach items="${releasesGenre.value}" var="release" varStatus="status" end="3">
<div class="productItem">
<c:if test="${release.affiliateThumbnail ne null}">
<div class="af lrg" style="background:url(/resources/images/affiliates/${release.affiliateThumbnail}) no-repeat;"></div>
</c:if>
<div class="coverArt">
<a class="productlink" href="/product/<str:seourl args1="${release.artist.name}" args2="${release.name}"/>?id=${release.id}">
<img src="${ release.imagePath }" width="134" height="134" alt="<c:out value="${release.name}"/> Image" />
</a>
</div>
<div class="buy">
<a href="#" id="buy_${ release.id }">Buy</a>
</div>
<div class="artistName">
<a class="productlink" href="/product/<str:seourl args1="${release.artist.name}" args2="${release.name}"/>?id=${release.id}"><c:out value="${release.artist.name}"/></a>
</div>
<div class="productName">
<a class="productlink" href="/product/<str:seourl args1="${release.artist.name}" args2="${release.name}"/>?id=${release.id}"><c:out value="${release.name}"/></a>
<%--<span class="fileType"> (${ release.fileType }) </span>--%>
</div>
<div class="price">
<c:choose>
<c:when test="${release.free}">${store.currency.htmlSymbol}FREE</c:when>
<c:otherwise>
${store.currency.htmlSymbol}${release.productPrices[store.id].price} ${ release.productPrices[storeId].price }
</c:otherwise>
</c:choose>
</div>
</div>