I have just came across something that I am unsure about. The link below gives an example of how to use an apex controller with VF. My question is, when does the constructor get called? There is no new keyword so no object is created and therefore the constructor never gets called. Does VF implicitly do this?


1 Answer 1


Yes the page constructs the controller and any extensions. See for example Order of Execution for Visualforce Page Get Requests:

A diagram of how a Visualforce page interacts with a controller extention or a custom controller class during a get request


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .