Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 731
Jaime Garcia Avatar asked Feb 24 '10 01:02

Jaime Garcia


1 Answers

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.

like image 178
Mahesh Avatar answered Oct 12 '22 01:10

Mahesh