JSF Navigation with Ajax(使用 Ajax 进行 JSF 导航)
问题描述
例如,如果我放置以下组件并单击它,它将按预期运行:
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 导航的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用 Ajax 进行 JSF 导航


- 如何显示带有换行符的文本标签? 2022-01-01
- 使用 iframe URL 的 jQuery UI 对话框 2022-01-01
- 是否可以将标志传递给 Gulp 以使其以不同的方式 2022-01-01
- 为什么悬停在委托事件处理程序中不起作用? 2022-01-01
- 如何向 ipc 渲染器发送添加回调 2022-01-01
- 从原点悬停时触发 translateY() 2022-01-01
- 在不使用循环的情况下查找数字数组中的一项 2022-01-01
- 我不能使用 json 使用 react 向我的 web api 发出 Post 请求 2022-01-01
- 为什么我的页面无法在 Github 上加载? 2022-01-01
- 如何调试 CSS/Javascript 悬停问题 2022-01-01