需要注意需要在.jsp文件中引入相应的类库
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

<select > <c:forEach items="${tqListAll}" var="tq"> <c:set var="isContains" value="${fn:contains(tqListSelected,tq.id)}" /> <c:choose> <c:when test="${isContains}"> <option value=${tq.id} selected="selected">${tq.name}</option> </c:when> <c:otherwise> <option value=${tq.id}>${tq.name}</option> </c:otherwise> </c:choose> </c:forEach> </select>

相关文章:

  • 2021-07-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案