日期:2014-05-18  浏览次数:20756 次

Unable to find a value 问题
情况如下:

HTML code

<c:forEach items="${sessionScope.trainingList}" var="trainingList">
    <tr class=titletdbg>
      <td width="84" height="21">
      <c:out value="${trainingList['startTime'] }"/>
      </td>
      <td height="21" colspan="4">
      <c:out value="${trainingList['collegeName'] }"/>
      </td>
      <td height="21">
      <c:out value="${trainingList['courses'] }"/>
      </td>
      <td height="21">
      <c:out value="${trainingList['CertorDegree'] }"/>
      </td>
    </tr>   
    </c:forEach>



添加进数据库时候,各个字段都允许为空,结果数据库里面是空的,但是取出来的时候。放到了List里面。现在就出错了。
Unable to find a value for "CertorDegree" in object of class "vo.file.TFileTraining" using operator "[]"

请问怎样处理这个……

------解决方案--------------------
CertorDegree
你把这个改成certorDegree
相应的方法改成 getCertorDegree setCertorDegree
试试
------解决方案--------------------
Unable to find a value for "CertorDegree" in object of class "vo.file.TFileTraining" using operator "[]" 
哎,命名规范。。。。
------解决方案--------------------

------解决方案--------------------
数据库的当然可以了,但是在java中变量命名有一定的规则,
很多时候会由于命名而出现一些找不到的错误,
java命名规则lz可以去google看看
------解决方案--------------------
对,名称,JavaBean对名字要求是很严格的,只能用小写开头