pata
pata

Reputation: 989

jsf2 flash is living longer that it should?

What i use: RichFaces version v.4.1.0.Final Mojarra 2.0.3

edit: i installed mojarra 2.1.11

So, im facing 2 problems.

1 - I'm going by flash, an object to see it in the next view. The problem is that when a re direct my page through the faces-config, the object never comes. When what i do is

Company companyToView = (Company)FacesContext.getCurrentInstance().getExternalContext().getFlash().get("publicProfileCompany");

I get nothing. This should not happen since before re directing to the new .xhtml i set value. How i set

FacesContext.getCurrentInstance().getExternalContext().getFlash().put("publicProfileCompany", record.getContactedCompany());
  return "goToPublicProfile";

2 - And in other pages, after the object is inserted in the flash its lives longer than one redirect. In one case its lives 6 times longer!

I would like to put code, but the post would be to long. If its needed i do it.

Upvotes: 2

Views: 141

Answers (1)

BalusC
BalusC

Reputation: 1108702

Mojarra 2.0.3 is a rather old version. It dates from 1 july 2010. That's over 2 years ago already! Older Mojarra versions are known to have exactly this flash scope related problems, which is reported by among others issue 1751.

Upgrade it to Mojarra 2.0.9 or 2.1.11 (the currently latest Mojarra 2.0 and 2.1) and your most flash scope related problems should disappear. There's only one specific flash scope related problem left: it won't work when you redirect to a page in a different path (folder), but it should work when you redirect to a page in the same path (folder).

Upvotes: 2

Related Questions