将 ejb 实体导入 Tapestry 项目在“生成的 sorces (jax-ws)”中看起来像这样
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.datatype.XMLGregorianCalendar;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "money", propOrder = {
"moneyAmount",
"moneyCurrency",
"moneyDate",
"moneyFinishDate",
"moneyIO",
"moneyId",
"moneyName",
"moneyNextDate",
"moneyNumber",
"moneyPurpose",
"moneyRenewal",
"moneyTs"
})
public class Money {
protected Double moneyAmount;
protected String moneyCurrency;
@XmlSchemaType(name = "dateTime")
protected XMLGregorianCalendar moneyDate;
@XmlSchemaType(name = "dateTime")
protected XMLGregorianCalendar moneyFinishDate;
protected MoneyIO moneyIO;
protected Integer moneyId;
protected String moneyName;
@XmlSchemaType(name = "dateTime")
protected XMLGregorianCalendar moneyNextDate;
protected Integer moneyNumber;
protected String moneyPurpose;
protected MoneyNextTimeType moneyRenewal;
@XmlSchemaType(name = "dateTime")
protected XMLGregorianCalendar moneyTs;
// Getters and Setters for above
...
}
所有 XMLGregorianCalendar 都是 ejb 模块中的日期
在挂毯页面类中:
@ejb
statefullEjbMoney
@Persist
@Property
List<Money> mylist
void onPrepareForRender() {
mylist=statefullEjbMoney.findAll();
}
在我的模板中,我有:
<table t:type="grid" t:source="mylist"
t:rowsPerPage="10" t:pagerPosition="both"
t:exclude="moneyId,moneyIO,moneyNextDate,moneyFinishDate,cliClientId"
t:reorder="moneyName,moneyPurpose,moneyAmount,moneyCurrency,moneyDate">
[Grid here]
</table>
glassfish 日志中的堆栈跟踪是:
Render queue error in SetupRender[Expenses:grid.columns]: Bean editor model for logic.ws.Money does not contain a property named 'moneyDate'.
org.apache.tapestry5.ioc.internal.util.TapestryException: Bean editor model for logic.ws.Money does not contain a property named 'moneyDate'. [at classpath:org/apache/tapestry5/corelib/components/Grid.tml, line 6]
...
Caused by: org.apache.tapestry5.ioc.util.UnknownValueException: Bean editor model for logic.ws.Money does not contain a property named 'moneyDate'.
at org.apache.tapestry5.internal.beaneditor.BeanModelImpl.get(BeanModelImpl.java:160)
at org.apache.tapestry5.internal.beaneditor.BeanModelImpl.reorder(BeanModelImpl.java:223)
at org.apache.tapestry5.internal.beaneditor.BeanModelUtils.reorder(BeanModelUtils.java:107)
at org.apache.tapestry5.internal.beaneditor.BeanModelUtils.modify(BeanModelUtils.java:51)
at org.apache.tapestry5.corelib.components.Grid.getDataModel(Grid.java:523)
at org.apache.tapestry5.corelib.components.GridColumns.setupRender(GridColumns.java:112)
at org.apache.tapestry5.corelib.components.GridColumns.setupRender(GridColumns.java)
at org.apache.tapestry5.internal.structure.ComponentPageElementImpl$SetupRenderPhase.invokeComponent(ComponentPageElementImpl.java:179)
at org.apache.tapestry5.internal.structure.ComponentPageElementImpl$AbstractPhase.invoke(ComponentPageElementImpl.java:138)
... 84 more
如果有人知道出了什么问题,请分享?