使用 Ajax 进行 JSF 导航 [英] JSF Navigation with Ajax

查看:19
本文介绍了使用 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 导航的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆