简体   繁体   English

首次通过URL加载XPage时,使用了哪些JSF阶段?

[英]When an XPage is first loaded via a URL which JSF phases are used?

When a user accesses an XPage for the first time is the JSF lifecycle phase 6 (Render Response) the only phase that is executed? 当用户第一次访问XPage时,JSF生命周期阶段6(Render Response)是唯一执行的阶段吗? Is executed the correct term? 执行正确的期限吗?

EDIT: Here someone explains his observations regarding the XPages lifecycle. 编辑: 这里有人解释他对XPages生命周期的观察。 He made tests by himself because of a lack of documentation. 由于缺乏文档,他自己进行了测试。 Maybe it's a bit old. 也许有点老了。

I don't know for sure but XPages bases on JSF so I would suggest that all JSF-phases get cycled through: 我不确定,但是XPages是基于JSF的,所以我建议所有 JSF阶段都要循环遍历:

Restore View -> Apply Request Values -> Process Validations -> Update Model Values -> Invoke Application -> Render Response

在此输入图像描述

But there are for sure ways to interrupt those phases. 但是,肯定有中断这些阶段的方法。

Hope this helped, have Fun! 希望对您有所帮助,玩得开心!

GET vs. POST requests are handled differently. GET与POST请求的处理方式不同。 GET' require the least amount of processing (createView / restoreView [aka. Phase 1 - RESTORE_VIEW] followed by renderResponse [aka. Phase 6 - RENDER_RESPONSE]. GET”需要最少的处理量(createView / restoreView [aka。第1阶段-RESTORE_VIEW],然后是renderResponse [aka。第6阶段-RENDER_RESPONSE]。

The XPages Core Runtime does indeed build upon JSF... but there are differences in how the Request Processing Lifecycle is executed - XPages provides optimizations to deal with complex Ajax handling, complex Partial Execution and so on. XPages Core Runtime确实确实基于JSF构建...但是执行请求处理生命周期的方式有所不同-XPages提供了优化以处理复杂的Ajax处理,复杂的部分执行等。 Effectively Phase 1 for a GET request does perform the createView/restoreView functions but bypasses some of the phase listening/notification steps to ensure the maximum throughput for a GET request. 实际上,GET请求的第1阶段确实执行了createView / restoreView函数,但绕过了某些阶段的侦听/通知步骤,以确保GET请求的最大吞吐量。

I provided a simple example on OpenNTF.org / XSnippets to help people examine / practice with the XPages Request Processing Lifecycle under different circumstances. 我在OpenNTF.org/XSnippets上提供了一个简单的示例,以帮助人们在不同情况下使用XPages请求处理生命周期进行检查/练习。 I encourage you to look at: 我鼓励您看一下:

http://openntf.org/XSnippets.nsf/snippet.xsp?id=xpages-request-processing-lifecycle-explorer-code ... http://openntf.org/XSnippets.nsf/snippet.xsp?id=xpages-request-processing-lifecycle-explorer-code ...

Yes, on initial page load it skips directly to Render Response. 是的,在初始页面加载时,它会直接跳至“渲染响应”。 Which makes sense when you consider the job of the other phases. 当您考虑其他阶段的工作时,这才有意义。 There's no data to be validated, because the user hasn't had a chance yet to submit any; 没有要验证的数据,因为用户还没有机会提交任何数据。 they also can't have invoked any events, etc. So the first request just renders, and subsequent requests go through the full lifecycle unless validation fails or is skipped. 它们也不能调用任何事件等。因此,第一个请求只是呈现,随后的请求将经历整个生命周期,除非验证失败或被跳过。

And yes, "executed" is the correct term. 是的,“执行”是正确的术语。 :) :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM