setRedirect(redirect)

Sets the value of the PageReference object's redirect attribute. If set to true, a redirect is performed through a client side redirect.

Signature

public System.PageReference setRedirect(Boolean redirect)

Parameters

redirect
Type: Boolean

Return Value

Type: System.PageReference

Usage

This type of redirect performs an HTTP GET request, and flushes the view state, which uses POST. If set to false, the redirect is a server-side forward that preserves the view state if and only if the target page uses the same controller and contains the proper subset of extensions used by the source page.

Note that if the URL of the PageReference object is set to a website outside of the salesforce.com domain, or to a page with a different controller or controller extension, the redirect always occurs, regardless of whether the redirect attribute is set to true or false.