gpt4 book ai didi

java - 异常 : source is null for getProperty(null, "agent")

转载 作者:行者123 更新时间:2023-11-30 04:38:38 26 4
gpt4 key购买 nike

我刚刚学习如何使用 Tapestry,但不断遇到以下错误

Exception: source is null for getProperty(null, "agent")    
ognl.OgnlRuntime.getProperty(OgnlRuntime.java:2203)

这是我的 html 页面中的代码

<tr>
<td valign="center" align="right" height="30"><span class="label1"> <span key="agentDeletionSalesParentActivityType" />&nbsp;:&nbsp;</span></td>
<td valign="center" align="left" height="30"><select jwcid="agentDeletionSalesParentActivityType@ActivityTypePropertySelection" regions="ognl:{activity.agent.region}" emptyOption="true" disabled="ognl:disabled" value="ognl:parentActivityType" /></td>
</tr>
<tr>
<td valign="center" align="right" height="30"><span class="label1"> <span key="agentDeletionSalesChildActivityType" />&nbsp;:&nbsp;</span></td>
<td valign="center" align="left" height="30"><select jwcid="agentDeletionSalesChildActivityType" regions="ognl:{activity.agent.region}" emptyOption="true" disabled="ognl:disabled" value="ognl:childActivityType" parent="component:agentDeletionSalesParentActivityType" /></td>
</tr>

这是我的java代码

@Persist
public abstract ActivityType getParentActivityType();
public abstract void setParentActivityType(ActivityType parent);

@Persist
public abstract ActivityType getChildActivityType();
public abstract void setChildActivityType(ActivityType child);

@Component(id="agentDeletionSalesChildActivityType", type="ActivityTypePropertySelection")
public abstract ActivityTypePropertySelection getChildActivityPropertySelection();

如果您需要更多代码,我很乐意将其放在上面(保持较小,以免将代码堆积到页面中),任何人都可以看出为什么会返回此异常吗?

最佳答案

这似乎是说 activity 对象在此为空:

regions="ognl:{activity.agent.region}"

关于java - 异常 : source is null for getProperty(null, "agent"),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12818156/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com