Re: Review: stateSaving in server bug fix

From: Ed Burns <Ed.Burns_at_Sun.COM>
Date: Mon, 02 Aug 2004 15:13:57 -0700

>>>>> On Mon, 02 Aug 2004 14:19:11 -0700, Jayashri Visvanathan <Jayashri.Visvanathan_at_Sun.COM> said:

JV> Fix a long standing state saving in server bug that causes the most
JV> recent view to be restored instead of the one that caused the
JV> postback when there are multiple views of the save viewId in session.

JV> M src/com/sun/faces/
JV> added a constant identifier "WINDOW_ID"

JV> M src/com/sun/faces/application/
JV> modified saveSerializedView() and restoreView() to use the combination
JV> of viewId and random number to correctly identify the view to
JV> restore.

I'd like to see a comment here that calls out the contract between this
method and FormRenderer.encodeEnd().

JV> + Map requestMap = context.getExternalContext().getRequestMap();
JV> + String windowId = (String)requestMap.get(RIConstants.WINDOW_ID);
JV> + // clear the temporary attribute.
JV> + requestMap.put(RIConstants.WINDOW_ID, null);

Also, you call getWindowIdFromRequest() twice when I don't see why you
need to do so:

JV> + String windowId = getWindowIdFromRequest(context);
JV> + // if a windowId can be retrieved from request, use that in
JV> + // combination with viewId to restore the view from session. If not,
JV> + // use viewId as the key.
JV> + if (windowId != null ) {
JV> + uniqueViewId = viewId + "_" + getWindowIdFromRequest(context);

StateManager doesn't need to import java.util.Random.

JV> M src/com/sun/faces/renderkit/html_basic/
JV> render a hidden field to store the random number.

- must the FormRenderer be the one that maintains the random number
  generator ivar? I can understand that it might be but I want to just
  be sure that you can't hang it on the StateManager. It seems to make
  more sense there.


|  | {home: 407 294 2468, office: 408 884 9519 OR x31640}
| homepage:         |
| aim: edburns0sunw | iim:
To unsubscribe, e-mail:
For additional commands, e-mail: