Seam 页面操作通常是作为初始请求还是在回发时执行?
我在我的一个视图上实现了一些页面操作..看起来当我加载或访问页面/视图时.. 我的组件上的方法每次都会执行..这是接缝中的正常行为还是我遗漏了一些东西...
我已经解决了我的问题..我想要完成的是通过键入请求页面时的初始请求地址栏中页面的页面 URL 或书签结果中的页面 URL。 在 SEAM 中,它是通过调用页面操作来实现的。您可以在组件描述符或 component.xml 中声明页面操作...
<page view-id="/list.xhtml">
<action execute="#{conpoentName.componentMethod}" on-postback="false"/>
如果未声明 on-postback 属性..当我尝试访问页面时,会发生继续调用组件方法..这就像无限调用..
有人知道后台发生了什么吗?...它的接缝与回发有关..
I implemented some page action on one of my view..it appears that when i load or access the page/view..
the method on my component get executed every time..IS this normal behavior in seam or i am missing something...
I already solved my problem..What i am trying to accomplish is a initial request when a page is requested either by typing the page URL of the page in the address bar or from a result of a bookmark.
In SEAM it is achieved via they call page action.You declare page action in component descriptor or the component.xml...
<page view-id="/list.xhtml">
<action execute="#{conpoentName.componentMethod}" on-postback="false"/>
If the attribute on-postback is not stated..what happen is a continues call to component method when i tried to access the page..it's like having a infinite call..
Anybody knows what is happening in the background?..Its seams related to postback..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,这是正常行为。查看 Seam 常见问题 JSF 回发
您希望在页面初始加载时执行某个操作,如果您不希望在重复访问时执行该操作,则可以使用 Postback 属性,或者在执行方法中放置一些逻辑来阻止它。
Yes it is normal behavior. Take a look at Seam FAQ JSF Postback
You want to perform an action when a page is initially loaded, if you don't want that action executed on repeated access you use the Postback attribute, or put some logic in the execute method to prevent it.