未调用接缝页面操作

发布于 2024-09-24 12:10:19 字数 557 浏览 0 评论 0原文

我有一个显示实体的页面,但在渲染页面之前,我需要根据传入的参数执行实体查找。为此,我尝试使用在中声明的 Seam 页面操作我的pages.xml 文件在渲染页面之前调用查找操作。我的设置如下所示:

pages.xml:

<page view-id="/mypage.xhtml" action="#{mylookup.lookupEntity}"></page>

我的操作类:

@Name("myLookup")
@AutoCreate
public class MyLookup {

@RequestParameter
private String myParam;

...

public void lookupEntity() { ...}

...
}

对我来说一切看起来都很好,但是当我单击链接将我带到该页面时,我的lookupEntity()操作永远不会被调用。我添加了断点和日志语句,很明显它永远不会被调用。

造成这种情况的典型原因是什么?我是否应该在某个地方寻找有关失败原因的更多信息?

I've got a page that displays an entity, but before rendering the page I need to perform a lookup of the entity based on a parameter that is passed in. To do this, I'm trying to use a Seam Page Action declared in my pages.xml file to call the lookup action before rendering the page. My setup looks like this:

pages.xml:

<page view-id="/mypage.xhtml" action="#{mylookup.lookupEntity}"></page>

My action class:

@Name("myLookup")
@AutoCreate
public class MyLookup {

@RequestParameter
private String myParam;

...

public void lookupEntity() { ...}

...
}

Everything looks fine to me, but when I click on a link to take me to that page, my lookupEntity() action never gets called. I've added breakpoints and logging statements, and it's clear that it never gets called.

What is a typical cause for this? Is there someplace I should be looking for more info on why this failed?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

沧笙踏歌 2024-10-01 12:10:19

很简单,因为调用的组件名称 (#{myLookup.lookupEntity}) 组件名称 (#{myLookup.lookupEntity}) 不匹配。

Simply because the called component name (#{mylookup.lookupEntity}) does not match component name (#{myLookup.lookupEntity}).

紫﹏色ふ单纯 2024-10-01 12:10:19

我也怀疑它不起作用,直到我用 log.info 替换 log.trace 并看到它起作用。也许你们中的一些人也陷入了我经历过的同样的陷阱。

I also suspected it does not work, till I replace log.trace with log.info and saw that it does. Maybe some of you are falling on the same trap I went through.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文