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