function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
DCSDCS 

controller in visual force

I am new to Visual force. I am confused with the state of controller. Is controller like a session bean in java? Does it maintain the state of member variables  during the entire session. Or does each request reinitialize the member variables?
Ron HessRon Hess

the page + controller do maintain a view state, variables in the controller, which persists while you are on that page and doing partial page updates.

You can clear the view state with pageReference.setRedirect(true);

 

visiting another page and returning to your page would not, unless you passed variables in on the URL.  those are available in the controller.