需要注意需要在.jsp文件中引入相应的类库
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<select id="rights" name="rights" multiple="multiple">
<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>