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;" onmouseover="this.title=this.options[this.selectedIndex].text">  -->
<%-- </s:select> --%>

 

在csdn上面看到这段,省得敲就拷贝了。对于这种s:select标签的id或者name里面有变量的,会报错,所以搜了一下,貌似没有解决方法。所以只好分下来写了。

你可能感兴趣的:(jsp,EL)