+ Start a Discussion
Lee SinLee Sin 

Visualforce write logic in action or in constructor?

If I have an operation that runs on page refresh or load, where should I put that logic?

Should I put it in the controller's constructor or a method and add an 'action' property in the <apex:page action={!***}></apex:page>

Is there any difference?
The action method is invoked before the page is rendered, so it really depends on what you want to accomplish.