JSF隐式与显式导航 [英] JSF implicit vs. explicit navigation
问题描述
I was considering using explicit page navigation rules in my web app when I came accross this SO question/answer, with the following excerpted from it:
...由于新的隐式导航"功能,自JSF 2.0起,导航规则已过时.
...navigation rules are obsolete since JSF 2.0 thanks to the new "implicit navigation" feature.
但是,我已经阅读了大部分 CoreServlets JSF 2.0教程,它的一部分专门用于显式页面导航,并且对此进行了好评.要么违反了上述建议,要么是我误解了什么.
However, I've gone through most of the CoreServlets JSF 2.0 tutorial, and it has a section devoted to explicit page navigation, and it talks favorably about it. Either this goes against the above recommedation, or am I misinterpreting something.
我不想过时地创建新的Web应用程序.任何人都可以照亮吗?
I don't want to create a new web app in an obsolete manner. Can anyone shed any light?
推荐答案
这有点主观,但是,它可以归结为以下内容:
This is somewhat subjective, but ala, it boils down to the following:
-
XML中的导航规则是个维护难题.
Navigation rules in XML are a maintenance hell.
使用导航规则表明,所涉及的Web应用程序存在"URL落后"的问题,这会导致不良的用户体验(页面无法添加书签).
Using navigation rules suggests that the web application in question suffers from the "one URL behind" problem which causes bad user experience (pages are not bookmarkable).
使用导航规则表明有问题的Web应用程序正在使用POST进行页面到页面的导航,这不仅会导致不良的用户体验(页面无法添加书签),还会导致不良的SEO(机器人无法编制索引) POST,因此公共搜索引擎无法访问POST导航的页面.
Using navigation rules suggests that the web application in question is using POST for page-to-page navigation which causes not only bad user experience (pages are not bookmarkable), but also bad SEO (bots don't index POST, hence POST-navigated pages are unreachable for public search engines).
另请参见:
- 如何在JSF中导航?如何使URL反映当前页面(而不是上一页)
- 通过查看参数"功能的可书签性
- 何时应使用h:outputLink而不是h:commandLink ?
- JSF 2.0中的通信-隐式导航
- How to navigate in JSF? How to make URL reflect current page (and not previous one)
- Bookmarkability via View Parameters feature
- When should I use h:outputLink instead of h:commandLink?
- Communication in JSF 2.0 - Implicit navigation
See also:
这篇关于JSF隐式与显式导航的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!