jsf中有类似的用法吗?还是我的tld版本的问题?
现在偶用jsf/myfaces下做了个简单的读取数据在循环显示的例子。
但可能dtd之类的版本问题,2.4的如下,web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
jsp页面中我想循环显示数据,如下
<c:forEach items="${productListBean.liProdcutList}" var="prodlist">
<table border="1" cellpadding="3" style="border-collapse: collapse" id="table1" width="100%">
<tr>
<td class="tHead" width="100">name</td>
<td class="tData"><c:out value="${prodlist.productnamej}" /> </td>
</tr>
<tr>
<td class="tHead" width="100">price</td>
<td class="tData"><c:out value="${prodlist.sellingprice}" /> </td>
</tr>
<tr>
<td class="tHead" width="100">profit</td>
<td class="tData"><c:out value="${prodlist.profitprice}" /> </td>
</tr>
</table>
<br>
</c:forEach>
但系统报错。
大家有好的方法吗,jsf中list数据能象上述一样循环显示在页面上。
如果我用
<h:dataTable id="books" value="#{productListBean.liProdcutList}" var="prodlist" border="1" cellpadding="6">
<h:column>
之类的话显示比较难看,不符合要求。
请大家帮帮忙