You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Patrick McCabe <pa...@gmail.com> on 2006/05/30 14:54:07 UTC

JSF Portlet Losing Request Scope Data

Hi All,

I have just finished putting together a very simple jsf application and am
running into the following problem which was brought up previously by Aaron
Evans.  Here is his post which describes the problem.

The full post can be found at:
http://www.mail-archive.com/jetspeed-user@portals.apache.org/msg01282.html

2. The second problem seems to be with JSF apps used in the portal in general.
At least it manifests itself with both the myfaces portlet implementation and
the jsf-app that uses the bridge.  Basically, I have a managed bean in the
request scope and a html form that references it and posts to an action.  I
have a navigation rule sending the user back to the html form.  Since I am
not using the redirect option in my navigation rule, the form values should
show up in the html (since a forward was done).  This is not happening, the
form/bean data is lost.  If I use the app outside of jetspeed, then the data
is *not* lost.

Does anybody know if there is a fix for this ? Thanks

Pat McCabe

Re: JSF Portlet Losing Request Scope Data

Posted by Aaron Evans <aa...@gmail.com>.
Wouldn't the second problem you report below again be the same problem
of the loss of request scoped data that I mentioned toward the bottom
of my September post?

It's been a while since I looked at this stuff, but I suspect the loss
of the request scoped data is because when you post your data, it is
handled in the action phase and the form values are displayed back in
the render phase.  Since request attributes do not carry from the
action phase to the render phase, this would explain the loss of these
objects.

I believe that what was done in the struts bridge (I could be wrong)
was to capture all of the request scoped data at the end of the action
phase, create some corresponding session attributes and then put them
back in the render phase and remove them from the session.  Or at
least something along those lines.

If you are *not* using the JSF bridge, you could try that and see if
that fixes the problem.

Otherwise, my suggestion for now would be to put your form in the
session scope.  When I worked a lot in struts, I used to always keep
form data in the request in the interest of memory, but since working
with portlets, I have reluctantly moved to more session based data.

If you have tried the JSF bridge and the request scoped data is still
lost, you should probably report it as a bug in the bridges project...

HTH,
aaron

On 5/30/06, Patrick McCabe <pa...@gmail.com> wrote:
> Hi All,
>
> I have just finished putting together a very simple jsf application and am
> running into the following problem which was brought up previously by Aaron
> Evans.  Here is his post which describes the problem.
>
> The full post can be found at:
> http://www.mail-archive.com/jetspeed-user@portals.apache.org/msg01282.html
>
> 2. The second problem seems to be with JSF apps used in the portal in general.
> At least it manifests itself with both the myfaces portlet implementation and
> the jsf-app that uses the bridge.  Basically, I have a managed bean in the
> request scope and a html form that references it and posts to an action.  I
> have a navigation rule sending the user back to the html form.  Since I am
> not using the redirect option in my navigation rule, the form values should
> show up in the html (since a forward was done).  This is not happening, the
> form/bean data is lost.  If I use the app outside of jetspeed, then the data
> is *not* lost.
>
> Does anybody know if there is a fix for this ? Thanks
>
> Pat McCabe
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org