使用 Ajax 进行 JSF 导航
- 作者: 阴隐淫音
- 来源: 51数据库
- 2022-10-25
问题描述
例如,如果我放置以下组件并单击它,它将按预期运行:
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.
推荐阅读
热点文章
检查拆分键盘
0
带有“上一个"的工具栏和“下一个"用于键盘输入AccessoryView
0
Activity 启动时显示软键盘
0
UIWebView 键盘 - 摆脱“上一个/下一个/完成"酒吧
0
在 iOS7 中边缘滑动时,使键盘与 UIView 同步动画
0
我的 iOS 应用程序中的键盘在 iPhone 6 上太高了.如何在 XCode 中调整键盘的分辨率?
0
android:inputType="textEmailAddress";- '@' 键和 '.com' 键?
0
禁用 iPhone 中键盘的方向
0
Android 2.3 模拟器上的印地语键盘问题
0
keyDown 没有被调用
0
