Logs will show the following error.
INFO: Facelet[/pages/menu.jspx] was modified @ 11:45:04 AM, flushing component applied @ 11:41:30 AM
The reason being, when ever a new request is made, server sees the page as modifed in future time stamp and starts compiling again. This causes the component tree to be created again, causing to lose all the state stored by the component.
To fix this add facelets.REFRESH_PERIOD to the web.xml.
REFRESH_PERIOD indicates, When a page is requested, what interval in seconds should the compiler check for changes. If you don't want the compiler to check for changes once the page is compiled, then use a value of -1. Setting a low refresh period helps during development to be able to edit pages in a running application.
web.xml, should look like this,
-1 indicates not to check for changes, since production servers it is safe to set this value.
For more,
This worked !!!.. Thanks
ReplyDeletePaul
Thanks.
ReplyDeleteGreat solution
Heh, +1 thanks, good catch.
ReplyDeleteCheers,
M
Thanks a lot ..it works ...can u provide details of it ..why it happens and how does it is altered by writing the stated context.
ReplyDeleteYou are the man! After 8 hours suffering I found your suggestion and it worked just like in my dreams! :) Thanks a lot
ReplyDelete