myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From SimonSays <>
Subject Re: <t:saveState> problems (not working / have tried everything)
Date Fri, 12 Jan 2007 05:21:50 GMT

So why is it that I read if you use <t:saveState> that the BB must implement
Serializable?  So something that is serializable does not necessarily write
out a file system file, but can store the file in memory as well?

Also if STATE_SAVING_METHOD set to "server" saves a "file" the the
HttpSession what does STATE_SAVING_METHOD set to "client" do differently?

how do I tell if the whole object is being serialized (state saved) rather
than just some property in a bean?  I may hit the breakpoints but I want to
see the actual data somewhere and watch it get restored as well.  I do not
believe <t:saveState> is working but do not know why.  I need to know for
sure that it is not working before I go and try to find out why.



Simon Kitching-3 wrote:
> support wrote:
>> How would I know if my <t:saveState> is working or not (by looking at 
>> physical files)?
>> I set STATE_SAVING_METHOD to "client" in my web.xml and supposed I would 
>> see something in the source html file.  My saveState looked like this:
>>    <t:saveState id="idSaveObject" value="${object}"
>> I searched in the html source (in browser) looking for "idSaveObject" 
>> and saw nothing.  If SAVE_STATE_METHOD is "client" where (what file) can 
>> I verify that saveState is working?
> You won't be able to tell from inspecting the html. There will be a 
> field called "jtree_64" or something like that (can't remember the exact 
> name), with a big long hex string in it (like "ABCD12345......"). This 
> is the base64-encoded representation of the entire component string, and 
> you would have to decode that to see what is stored. Believe me, you do 
> not want to do that.
>> ---
>> I then set SAVE_STATE_METHOD to "server" and made my BB implement 
>> serializable and searched under the <TOMCAT_ROOT>/work/ directory for 
>> *.ser and looked at each file but saw nothing.  I supposed that 
>> SAVE_STATE_METHOD "sever" means that it serialized the BB, but saw 
>> nothing that indicated the BB had been serialized.  Am I looking in the 
>> right place for Tomcat.
> It serializes the entire component tree, and stores it into the http 
> session. This typically exists only in memory, though if the webserver 
> finds itself short of memory it might start saving http sessions to 
> disk. You really won't want to go hunting through those though.
>> ---
>> How do I tell for sure if <t:saveState> is working and what could be the 
>> problem?
> Add a breakpoint, or some logging, on the get/set methods you point the 
> t:saveState component to. eg if you have
>   <t:saveState value="#someBean.someObject"/>
> then add logging or breakpoints to methods
>    getSomeObject
> and
>    setSomeObject.
> The get will be called during the rendering phase, and the set will be 
> called during the restore-view phase.
> Regards,
> Simon

View this message in context:
Sent from the MyFaces - Users mailing list archive at

View raw message