I have two Visualforce pages for example Page1 and Page2. From Page1 method, by using Page reference I am calling Page2. In Page2 controller constructor, i am executing code that code has to be executed when ever controller called from Page2, not from Page1.
Page1 Code
PageReference pageRef = new PageReference('/apex/page2?data='+i+'');
pageRef.setRedirect(true);
in Page2 constructor
public page2Constructor() {
panel = true;
}
Above panel=true
needs to execute whenever it called from Page2, not from Page1.