如何获取Javabean中的ui:param值
我正在学习facelets和Seam,我面临以下问题:我有2个xhtml文件,一个包含另一个,每个文件都有自己的Seam组件作为支持bean。我想发送对象并发送对象到包含的 Facelet,并在与包含的 Facelet 相对应的支持 bean 中获取该对象。我将举一个例子来更好地解释这种情况:
- registration.xhtml,以 Seam 组件作为支持 bean Registration.java。在这个类中,我有一个 Person address.html 类型的对象,
- 其中 Seam 组件作为支持 bean Address.java。在此类中,我想从注册组件获取 Person 对象并设置地址。
- Registration.xhtml 包含 address.xhtml 并使用
How to acquire this object in Address bean? 传递一个对象注册 bean 中的对象引用是否相同? ui:param 是传递该对象的解决方案还是有其他解决方案? (也许是f:attribute,但即使在这种情况下,我如何获取bean中的对象)
这个例子很简单,不一定现实,但我有类似的问题,我不知道如何解决它。
提前致谢。
I am learning facelets and Seam and I'm facing the following problem: I have 2 xhtml files, one includes the other and each one has its own Seam component as backing bean. I want to send and object to the included facelet and obtain that object in the backing bean corresponding to the included facelet. I'll take an example to explain better the situation:
- registration.xhtml with Seam component as backing bean Registration.java. In this class I have an object of type Person
- address.html with Seam component as backing bean Address.java. In this class i want to obtain the Person object from the Registration component and set the address.
- registration.xhtml includes the address.xhtml and passes an object using
How to obtain this object in Address bean? Will be the same reference of the object from the Registration bean? ui:param is the solution of passing this object or there is another solution for that? (maybe f:attribute, but even in this case how do I obtain the object in bean)
This example is simple and not necessarily realistic but I have a similar problem and I don't know how to solve it.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用页面操作来连接您的 bean
...
如果您想在初始请求 (GET) 期间进行连接,请执行以下操作
You could use a Page action to wire your bean
...
If you want to wire during an initial request (GET), do as follows