从Flash范围获取参数的JSF在Internet Explorer

时间:2015-09-10 13:11:53

标签: internet-explorer jsf jsf-2.2 flash-scope

我们的项目正在

JSF 2.2(Mojorra 2.2.0)

Servlet 3.0:Jboss EAP 6.1

Facelets(XHTML)

当我们将参数放入Flash时,我们无法从I.E中的另一个页面获取它。浏览器。我们在I.E.尝试过。 11在不同的机器上。 奇怪的是,Chrome,Opera是可以的。

将参数放入Flash时的代码:

public String pageDirect(String url, ExtendedModel entity) {
    Flash flash = FacesContext.getCurrentInstance().getExternalContext().getFlash();
    flash.put("instance", entity);

    return url + "?faces-redirect=true";
}

获得参数时的代码。来自Flash:

@SuppressWarnings("unchecked")
public ExtendedModel getInstance() {
    Flash flash = FacesContext.getCurrentInstance().getExternalContext().getFlash();
    instance = (ExtendedModel) flash.get("instance");
    if (instance == null) {
        instance = createInstance();
    }
    return instance;
}

获得"实例"来自Flash的param,实例为null。 在调试模式下,我们可以看到:Flash.flashInnerMap是{1 = {instance = 2 - ORNEK SPOR SALONU}}

在IE(大多数版本)中,从Flash返回的参数是空的,但在其他浏览器中是可以的。

有人有想法吗?

0 个答案:

没有答案