0

这是场景:我的应用程序有一个包含不同区域的主页。该页面加载所有区域,而不是一个使用单独线程运行且需要很长时间的区域。现在在执行长时间运行的任务期间,如果用户想通过单击命令链接或 goLink 导航到另一个页面,那么它适用于 google chrome 和 IE,但不适用于 Firefox。如果是firefox,它似乎会暂时重定向到所需的url,但随后会重定向回同一页面。令人惊讶的是,一旦完成长时间运行的任务,它就可以完美运行。因此,Firefox 处理异步请求似乎有问题。我尝试了 FacesContext.getCurrentInstance().getExternalContext().redirect(url) 并将 URL 设置为 goLink 导航的目的地。下面是 goLink 和 commandLink 的代码:

af:goLink id="pt_g22" text="#{node.title}" 目的地="#{contextroot}/faces/test.jsp" styleClass="#{node.selected ? 'ln_active' : ''}"/ >

af:commandLink id="pt_c21" text="#{node.title}" action="pprnav" clientComponent="#{node.attributes['Target'] == '_popup' ? true : false}" styleClass=" #{node.selected ? 'ln_active' : ''}" actionListener="#{MyBean.navigateToHere}" partialSubmit="true">

在 commandLink 的 actionListener 方法中,我只有:FacesContext.getCurrentInstance().getExternalContext().redirect(url)

任何帮助或建议表示赞赏。

4

0 回答 0