JSF 跳过阶段 - 如何调试?

标签 jsf skip phase

我正在调试一个外国 JSF 应用程序。
问题是,我提交了一个表单,但值没有被结转。

使用阶段监听器我可以看到,生命周期没有完全运行,所以说它跳过阶段 2 -5:在恢复 View 阶段之后,直接调用渲染响应阶段。我想念应用值、验证、更新模型操作等。

所以,这可能是一个先有鸡还是先有蛋的问题:
1. 负责的阶段没有被调用,所以新的表单输入不能结转。
2.系统不识别任何新的输入,因此在恢复 View 后直接渲染。

我检查了没有调用 responseComplete() 或 renderResponse()。

我被卡住了。任何想法来验证这两个假设之一?或者一般如何调试?有人遇到过类似的问题吗?

更新

我怀疑 JSF 不知道回发请求并像初始 View 一样处理它。那可以解释,我只通过了第 1 阶段和第 6 阶段。

我如何检查 JSF 是否将其识别为非面孔请求?
如何检查当前 facesContext 中是否有合适的 treeID .

最佳答案

我引用了我发布的答案 before :

Whenever an UICommand component fails to invoke the associated action, verify the following:

  1. UICommand components must be placed inside an UIForm component (e.g. h:form).
  2. You cannot nest multiple UIForm components in each other (watch out with include files!).
  3. No validation/conversion error should have been occurred (use h:messages to get them all).
  4. If UICommand components are placed inside an UIData component, ensure that exactly the same DataModel (the object behind the UIData's value attribute) is preserved.
  5. The rendered and disabled attributes of the component and all of the parent components should not evaluate to false during apply request values phase.
  6. Be sure that no PhaseListener or any EventListener in the request-response chain has changed the JSF lifecycle to skip the invoke action phase.
  7. Be sure that no Filter or Servlet in the same request-response chain has blocked the request fo the FacesServlet somehow.


因为在您的特定情况下,第 2-5 阶段被跳过,并且您确定(?)FacesContext#renderResponse()没有被调用,原因 3、6 和 7 可以从列表中删除。根据您调试 JSF 阶段的方式,原因 4 和 5 也可能被划伤。调查其他原因。我对事业 2 的评价。检查您是否没有看到 <form><form></form></form>在生成的 HTML 源代码中并在 JSF 源代码中回溯它。

关于JSF 跳过阶段 - 如何调试?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2712691/

相关文章:

tortoisesvn - 如果文件只更改了一次,为什么 Subversion/TortoiseSVN 会跳过修订号?

javascript - 如何使用 AVA 框架根据某些条件(比如环境变量)跳过测试执行

python - 从 csv 文件构建 Python 字典时如何跳过空白单元格?

matlab - 如何从 FFT 获取调幅信号的相位角

image - 绘制相位和幅度图像傅里叶

css - 在 JSF Web 应用程序中使用 SASS

java - jsf *.xhtml 映射不起作用,重定向到 jsp

jsf - java.lang.ClassNotFoundException : com. 太阳.faces.config.ConfigureListener

jquery - 如何在 paginatorTemplate 中使用 {totalPages}?

python - 如何消除 NumPy 特征向量分量的复杂角度的不连续性?