我有一些條件這個jsp頁面:JSP使用JSTL和腳本
<%
if (filterPresent.equals("true") && !selectedFilterCategory.isEmpty()){
%>
<c:if test="${entry.category eq param.selectedFilterCategory}">
<%
}
%>
RENDER A TABLE WITH ITEMS
<%
if (filterPresent.equals("true") && !selectedFilterCategory.isEmpty()) {
%>
</c:if>
<%
}
%>
如果filterPresent值是真的,我想只顯示部分項目(這些匹配的類別,)。如果它不存在,我想顯示所有項目。
我得到的錯誤是:
An error occurred at line: 48 in the jsp file: /jsp//ejbChildRule.jsp
Syntax error, insert "while (Expression) ;" to complete BlockStatements
45: %>
46: <c:if test="${entry.category eq param.selectedFilterCategory}">
47: <%
48: }
49: %>
50: <tr class="<%=currentBackground%>">
51: <td class="<%=currentBackground%>" align="left" valign="middle" nowrap>
我能達到什麼我希望用這種方式?
請提供一些更多的代碼行,然後將清楚地解決。 –
混合taglibs和scriptlets是個大麻煩。使用這一個或另一個,而不是兩個。我建議擺脫scriptlets altogheter,因爲這被認爲是近十年來的沮喪。 – BalusC