Typically, using a constructor is a way to go. However, if you do not want to use the constructor then you would have to call the controller method from your visual force page so that the method gets executed. Please refer the below link for reference.
Typically, using a constructor is a way to go. However, if you do not want to use the constructor then you would have to call the controller method from your visual force page so that the method gets executed.
Please refer the below link for reference.
- https://developer.salesforce.com/forums/?id=906F0000000BLQXIA4
Hope it will be helpful.Please mark it as best answer if the information is informative.
Best Regards
Rahul Kumar