aspose file tools*
The moose likes JSF and the fly likes STATE_SAVING_METHOD = client Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "STATE_SAVING_METHOD = client" Watch "STATE_SAVING_METHOD = client" New topic
Author

STATE_SAVING_METHOD = client

Joseph Sweet
Ranch Hand

Joined: Jan 29, 2005
Posts: 327
Hi Everyone,

Something is bothering my mind and I just cannot find the answer to it:
When I set javax.faces.STATE_SAVING_METHOD = client.....

Please tell me if I am right:
suppose I start at page A, submitting it and the response is page B. So on page B i have a hidden field that stores the status of the view A.
Then from page B, I keep submitting and the response is page C. So on page C i have a hidden field that stores the status of the views A and B.
Then from page C, I keep submitting and the response is page D....

You get the idea.

So when I get to page Z, i have a HUGE hidden field that includes the whole history of my current session....

Am I right?

If so, isn't it crazy?
[ February 16, 2008: Message edited by: Joseph Sweet ]

We must know, we will know. -- David Hilbert
Ryan Lubke
Ranch Hand

Joined: Jun 20, 2007
Posts: 36
Actually, you're not.

The state for PageA will be valid only for PageA.
When you submit the form, the state is used to reconstruct
PageA, apply the form data, and then navigate to PageB.
PageB's hidden field will only contain data relevant to PageB.
Joseph Sweet
Ranch Hand

Joined: Jan 29, 2005
Posts: 327


PageB's hidden field will only contain data relevant to PageB.



In your scenario, what if I were in Page B prior to my visit in Page A? Then When I come back to Page B, this page has no state, because no state of no page is saved on the session (i.e., on the server).
But when I was in Page B on the 1st time, I did change its state to be different than its default state. So where was it saved in your algorithm?
Joseph Sweet
Ranch Hand

Joined: Jan 29, 2005
Posts: 327
Well guys, nobody knows?

[ February 25, 2008: Message edited by: Joseph Sweet ]
Ryan Lubke
Ranch Hand

Joined: Jun 20, 2007
Posts: 36
Originally posted by Joseph Sweet:


In your scenario, what if I were in Page B prior to my visit in Page A? Then When I come back to Page B, this page has no state, because no state of no page is saved on the session (i.e., on the server).
But when I was in Page B on the 1st time, I did change its state to be different than its default state. So where was it saved in your algorithm?


When you change the state of PageB, then the state change will be present in the saved state of PageB. The saved state of one page has no impact on the saved state of another page.

I'd like to recommend you spend some time reading the specification if state saving is of interest to you.
Joseph Sweet
Ranch Hand

Joined: Jan 29, 2005
Posts: 327
Nice, but why talking about oranges when I ask about apples?
And if the answer is "go read the specification", then there was no reason for websites like this one.
Let's just write a little script that will answer every message with "go read the specification".
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61761
    
  67

There are many basic concepts that can be grasped by reading the specification. Sites like this exist when the specification is not enough.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Joseph Sweet
Ranch Hand

Joined: Jan 29, 2005
Posts: 327
And how would you like your egg, sir? Fried of poached?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: STATE_SAVING_METHOD = client