1. 程式人生 > 其它 >jsp報錯問題之“使用jstl的c標籤choose報錯Illegal text inside "c:choose" tag問題”

jsp報錯問題之“使用jstl的c標籤choose報錯Illegal text inside "c:choose" tag問題”

一.報錯

[bessky_it][ERROR][2022-03-25 17:19:07] | PLATFORM | ):[c]鍜孾/com.bessky.pss.portal/purchase/sample_apply_add.jsp]鐨凾agLibraryValidator鐨勯獙璇侀敊璇秷鎭�66: Illegal text inside "c:choose" tag: " | URL=sample/applys/create | com.bessky.platform.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:117)

二.問題程式碼

<c:choose>
<!--獲取登入人部門 = 209或 獲取登入人部門 = 245-->
<c:when test="${sessionScope.authenticated_user.department.departmentId == 209 ||sessionScope.authenticated_user.department.departmentId == 245}">
<app:select required="required" classes="input-medium" items="${domain.applyUsers }" listkey="userId" listvalue="display" headkey="1" headvalue="王子威" name="sampleApply.purchaseBy" select2="true"></app:select>
</c:when>
<c:otherwise>
<app:select required="required" classes="input-medium" items="${domain.applyUsers }" listkey="userId" listvalue="display" headkey="" headvalue="" name="sampleApply.purchaseBy" select2="true"></app:select>
</c:otherwise>
</c:choose>

三.原因

因為註釋問題:<!--獲取登入人部門 = 209或 獲取登入人部門 = 245-->導致的報錯

去掉註釋就好了(並非所有人有效)