>>>>> 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/RIConstants.java
JV> added a constant identifier "WINDOW_ID"
JV> M src/com/sun/faces/application/StateManagerImpl.java
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/FormRenderer.java
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.
r=edburns
--
| ed.burns_at_sun.com | {home: 407 294 2468, office: 408 884 9519 OR x31640}
| homepage: | http://javaweb.sfbay.sun.com/~edburns/
| aim: edburns0sunw | iim: ed.burns_at_sun.com
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_javaserverfaces.dev.java.net
For additional commands, e-mail: dev-help_at_javaserverfaces.dev.java.net