掲示板

Flash scope loosing messages during redirect

11年前 に Robson Miranda によって更新されました。

Flash scope loosing messages during redirect

New Member 投稿: 5 参加年月日: 11/03/24 最新の投稿
Hi,

I`m having a problem with the flash scope. If I have a navigation rule with "<redirect/>" defined, the messages stored in flash scope are lost, even though I had set the "keepMessages" flag in the flash object, using LiferayFacesContext.getInstance().getExternalContext().getFlash().setKeepMessages(true) before the redirect.

Is there something that I overlooked? I`m using Liferay 6.1 + LiferayFaces 3.1.0-rc2 + JSF 2.1.3-b02.

Thanks
Robson
11年前 に Robson Miranda によって更新されました。

RE: Flash scope loosing messages during redirect

New Member 投稿: 5 参加年月日: 11/03/24 最新の投稿
I sort of solved the problem. It seems that ICEfaces was causing double post (one from AJAX and other normal). I'll try to investigate further.
thumbnail
11年前 に Neil Griffin によって更新されました。

RE: Flash scope loosing messages during redirect

Liferay Legend 投稿: 2655 参加年月日: 05/07/27 最新の投稿
Would you consider this to be a bug in ICEfaces or perhaps in the bridge?
11年前 に Lee Taylor によって更新されました。

RE: Flash scope loosing messages during redirect

New Member 投稿: 1 参加年月日: 12/08/06 最新の投稿
It may be a bug in the Icefaces.
11年前 に Robson Miranda によって更新されました。

RE: Flash scope loosing messages during redirect

New Member 投稿: 5 参加年月日: 11/03/24 最新の投稿
I created a simple application, and the keepMessages works correctly if it is used out of Liferay. So, I think this bug is in the bridge.

添付ファイル:

thumbnail
11年前 に Neil Griffin によって更新されました。

RE: Flash scope loosing messages during redirect

Liferay Legend 投稿: 2655 参加年月日: 05/07/27 最新の投稿
Is it an ajax-based <redirect /> (portlet ResourceRequest) or does it invoke a full HTTP GET (portlet RenderRequest)?
11年前 に Robson Miranda によって更新されました。

RE: Flash scope loosing messages during redirect

New Member 投稿: 5 参加年月日: 11/03/24 最新の投稿
It's a AJAX-based redirect. I tested removing Icefaces JARs and the problem persists. I also tested using "action-url-redirect" setted to true in liferay-portlet.xml, and the messages are also lost.

Thanks.
Robson
thumbnail
11年前 に Neil Griffin によって更新されました。

RE: Flash scope loosing messages during redirect

Liferay Legend 投稿: 2655 参加年月日: 05/07/27 最新の投稿
OK I just created FACES-1386 in order to track this to closure. Please click on the "watch" link in JIRA for further updates. Unfortunately we will have to schedule this to be fixed after the GA1 release, since we're in a QA cycle at this time.
9年前 に Wojciech Tutro によって更新されました。

RE: Flash scope loosing messages during redirect

New Member 投稿: 22 参加年月日: 13/07/15 最新の投稿
Hi,

I am developing an application and I need to use flash scope but problem described here still appears. Do You have any workaround or fix for this?
thumbnail
9年前 に Neil Griffin によって更新されました。

RE: Flash scope loosing messages during redirect

Liferay Legend 投稿: 2655 参加年月日: 05/07/27 最新の投稿
Hi Wojciech,

Are you calling FacesContext.getCurrentInstance().getExternalContext().redirect(String) from your JSF backing bean? Or are you using <redirect/> in a navigation-rule? If you are doing it from a backing bean, then please try calling FacesContext.getCurrentInstance().getExternalContext().getFlash().setRedirect(true) first.

Please let us know if that works for you. We are currently investigating whether or not this should be done automatically by Liferay Faces Bridge, or if it should be the responsibility of the application developer.

Kind Regards,

Neil
thumbnail
9年前 に Neil Griffin によって更新されました。

RE: Flash scope loosing messages during redirect

Liferay Legend 投稿: 2655 参加年月日: 05/07/27 最新の投稿
Hi Wojciech,

I did some research and the Mojarra 2.1 NavigationHandlerImpl.java and Mojarra 2.2 NavigationHandlerImpl.java classes correctly call Flash.setRedirect(true) when executing a navigation-rule with <redirect/>.

Although the Mojarra 2.1 version does not call Flash.setKeepMessages(true), the Mojarra 2.2 version will indeed call that method if there is an f:viewAction tag inside of the f:metadata tag.

Kind Regards,

Neil
9年前 に Wojciech Tutro によって更新されました。

RE: Flash scope loosing messages during redirect

New Member 投稿: 22 参加年月日: 13/07/15 最新の投稿
Hi Neil,

Sorry for so big delay - I had lot of work last days.
In the mean time I had created some workaround for this issue. My problem was not exactly passing messages from one view to another but passing small object (as I can not use JSF2.2 with FlowScope I decided to "manually" pass the object through few pages). I ended up with bean in session scope.

Best regards,
Wojtek