天天看點

select 循環 attribute id does not accept any expressions

居然這樣隻寫 解決了

<select name="companyId">
<c:if test="${!empty listCompany}">
  <c:forEach items="${listCompany }" var="company">
    
  <option value="${company.id}">${company.chname }</option>
   
  </c:forEach>
</c:if>
</select>
<%-- <s:select list="" id="${val.count}" name="${val.count}" theme="simple" listKey="" listValue=""  --%>
<!-- 	cssStyle="width:100px;" οnmοuseοver="this.title=this.options[this.selectedIndex].text">  -->
<%-- </s:select> --%>
           

在csdn上面看到這段,省得敲就拷貝了。對于這種s:select标簽的id或者name裡面有變量的,會報錯,是以搜了一下,貌似沒有解決方法。是以隻好分下來寫了。