开发者

In JSF the "saveState()" method is being called twice. Why?

开发者 https://www.devze.com 2022-12-21 14:24 出处:网络
I put two output statements, one at the beginning of \"save()\" and开发者_开发问答 one at the end for a custom JSF component. The \"saveState()\" is in the UIComponent object. Why ar e my output state

I put two output statements, one at the beginning of "save()" and开发者_开发问答 one at the end for a custom JSF component. The "saveState()" is in the UIComponent object. Why ar e my output statements being printed twice? Basically this is what I see

"entering save"
"ending save"
"entering save"
"ending save"

Thanks.


The method is called on two different phases. While you call expensive operations from the controller make sure to check the phases and call on suitable phase only. For example, you want to call loading methods on Render response phase.


It looks like one of the jsf phases is called twice. Try to debug your app!
Is there a redirect involved?


There might be 2 threads executing the same prints. Set a breakpoint and you'll see :D

0

精彩评论

暂无评论...
验证码 换一张
取 消