例如,如果我放置以下组件并单击它,它将按预期运行:
If I place, for instance, the following component and click it, it behaves as expected:
<h:commandLink value="Click me" action="anotherPage.jsf" />
但如果我使用 Ajax:
But if I use Ajax:
<h:commandLink value="Click me" action="anotherPage.jsf"><f:ajax /></h:commandLink>
它不会导航到其他页面.我错过了什么吗?这不应该有效吗?
It doesn't navigate to the other page. Am I missing something? Isn't this supposed to work?
另一个问题是,当我在会话超时后单击使用 ajax 的按钮时,应用程序会重定向到登录页面,但它不会加载 css 文件.
Another issue is that, when I click a button that is using ajax after session timeout, the application redirects to the login page but it doesn't load css files.
有什么想法吗?
亲切的问候,
卡洛斯·费雷拉
如果您发送重定向,您可以做到.
You can do it if you send a redirect.
action="anotherPage.jsf?faces-redirect=true"
但是,我完全看不到像这样使用 Ajax 进行导航的意义/好处.
However, I completely fail to see the point/benefit of navigating using Ajax like that.
这篇关于使用 Ajax 进行 JSF 导航的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
在按钮之间添加空间?Adding space between buttons?(在按钮之间添加空间?)
Sencha Touch Ext.navigation.View pop to rootSencha Touch Ext.navigation.View pop to root(Sencha Touch Ext.navigation.View pop to root)
使用 CSS 和单个列表的简单 2 列导航?Simple 2-column navigation with CSS and a single list?(使用 CSS 和单个列表的简单 2 列导航?)
单页导航菜单 - 活动指示器Single page navigation menu - active indicator(单页导航菜单 - 活动指示器)
带有旋转文本的垂直导航vertical navigation with rotated text(带有旋转文本的垂直导航)
均匀分布的列表项Evenly spaced list items(均匀分布的列表项)