“返回”的最佳实践JSF 中的导航链接
制作“后退”链接的最佳方法是什么,以便应用程序在导航后保持一致。
onclick="history.go(-1)"
。这是非常有害的吗?- 在支持 bean 中使用堆栈来弹出最后一个视图的导航情况。您可以通过使用
设置导航案例来完成此操作。 - 这些都不是……其他解决方案。
任何帮助将不胜感激!分享你的想法! 丹尼尔
What is the best way to make "Back" links, so that the application stays consistent after navigation.
onclick="history.go(-1)"
. Is this very harmful?- Using a stack in a backing bean that pops you the navigation case of the last view. You can do this by setting the navigation case with
<f:setPropertyActionListener>
. - None of these... other solutions.
Any help would be appreciated! Share your thoughts!
Daniel
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您想通过编程导航链接来解决此问题,可以使用
LinkedList
作为堆栈。通过这种方式,您可以设置存储的导航案例数量的界限。示例:
因此,在“前向”链接中:
“后向”链接为:
If you want to solve this by programmed navigation links, you can use a
LinkedList
as a stack. This way you can set boundaries for the number of stored navigation cases.Example:
So in 'forward' links:
And a 'back' link would be:
我正在使用:
对于每个导航规则这确保了按下“后退”按钮或
history.go(-1)
时:PS "backlink" 有不同的含义
I'm using:
<redirect />
for each navigation ruleThis ensures that on pressing the "back" button or
history.go(-1)
:P.S. "backlink" has a different meaning