【发布时间】:2011-12-12 20:08:35
【问题描述】:
我添加了 2 个托管 bean: ProductController 有 2 种方法:
ist<ProdusDTO> getList()
String update()
和 ProductDTO,用于实体 Product。
index.jsp
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<h:dataTable value="#{ProductController.getList()}" var="p">
<h:column>
<f:facet name="header">Description</f:facet> #{p.description}
</h:column>
<h:column>
<f:facet name="header">Image</f:facet> #{p.image}
</h:column>
</h:dataTable>
<h2>Adds</h2>
<h:form>
<h:panelGrid columns="3">
Description: <h:inputText value="#{produsDTO.description}" size="100" required="true"></h:inputText>
Image: <h:inputText value="#{productDTO.image}" size="100" required="true" label="Image"> </h:inputText>
</h:panelGrid>
<h:commandButton value="Submit" action="#{ProductController.update()}" />
</h:form>
当我运行 jsp 文件时,我得到这个错误:
PWC6228: #{...} not allowed in a template text body.
在构建路径中,我包含了 jsf-api.jar 和 jsf-impl.jar (mojjara 1.2_15)
为什么我不能为 dataTable 组件指定 value 属性的方法?
谢谢。
【问题讨论】:
标签: templates jsf datagrid ejb