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

查看:234
本文介绍了JSF导航使用Ajax的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我的地方,例如,下面的组件,点击它,它表现为预期的:

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.

这篇关于JSF导航使用Ajax的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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