在entity中是有typeid这个字段的,但是在前台显示的时候,一直报这个错误:
Property 'typeid' not found on type java.lang.String
后台:
request.setAttribute("productTypes", qr.getResultList());
前台显示:
<c:forEach items="productTypes" var="type">
${type.typeid } ${type.name } ${type.note } <c:if test="${!empty type.parent }">${type.parent.name }</c:if>
</c:forEach>
将
items="productTypes"修改为
items="${productTypes }"解决问题。