Post/Redirect/Get

Post/Redirect/Get

Post/Redirect/Get (PRG) is a common design pattern for web applications, to help avoid duplicate form submissions and allow web applications to behave more intuitively with browser bookmarks and the reload button.

After a web user submits a form to a server, the server typically generates an HTML page as a response. To the user, this looks like an ordinary web page, but because it was generated by an HTTP POST request, it cannot be bookmarked, and attempting to reload/refresh the page in the browser could cause the form information to be resubmitted, possibly with unexpected results (such as a duplicate purchase).

To avoid this problem, many web applications use the PRG pattern — instead of returning an HTML page directly, the POST operation returns a redirection command (using the HTTP 303 response code (sometimes 302) together with the HTTP "Location" response header), instructing the browser to load a different page using an HTTP GET request. The result page can then safely be bookmarked or reloaded without unexpected side effects.

External links

* [http://www.theserverside.com/tt/articles/article.tss?l=RedirectAfterPost Redirect After Post] , Michael Jouravlev, August 2004
** [http://www.theserverside.com/patterns/thread.tss?thread_id=20936 Description of the pattern for J2EE] , Michael Jouravlev, August 14 2003m
* [http://adamv.com/dev/articles/getafterpost GET after POST] Adam Vandenberg
* [http://www.subbu.org/weblogs/main/2006/06/is_the_portlet.html Is the Portlet Programming Model Broken?] Subbu Allamaraju
* [http://www.ajaxray.com/blog/2008/01/12/how-to-avoid-postdata-resend-warning How to avoid POSTDATA resend warning] Anis uddin Ahmad


Wikimedia Foundation. 2010.

Игры ⚽ Нужно сделать НИР?

Look at other dictionaries:

  • Post/Redirect/Get — (PRG) общий шаблон проектирования для веб приложений, который обеспечивает защиту от повторной отправки данных веб форм и интуитивно понятное поведение веб приложений при использовании закладок в браузере и обновлении страниц. После того, как… …   Википедия

  • Post-Redirect-Get — Diagramme d un problème de multiple soumission …   Wikipédia en Français

  • Thumbnail gallery post — A thumbnail gallery post (TGP) is a common type of ad driven website that provides links to free Internet pornography. [ [http://www.cozyacademy.com/classrooms/tgp/index.asp Tutorial about TGPs and galleries] for adult webmasters, by Cozy Academy …   Wikipedia

  • PRG — can mean: * Short cut for Prague *Parti Radical de Gauche *Pontine respiratory group *Provisional Revolutionary Government of the Republic of South Vietnam *Post/Redirect/Get, a common design pattern for web applications *Programming Research… …   Wikipedia

  • PRG — Cette page d’homonymie répertorie les différents sujets et articles partageant un même nom.   Sigles d’une seule lettre   Sigles de deux lettres > Sigles de trois lettres   Sigles de quatre lettres …   Wikipédia en Français

  • Веб-программирование — Веб программирование. Бурно развивающийся раздел программирования, ориентированный на разработку динамических Internet приложений. Языки веб программирования  это соответственно языки, которые в основном предназначены для работы с интернет… …   Википедия

  • SAML 2.0 — Security Assertion Markup Language (SAML) is an XML standard for exchanging authentication and authorization data between security domains. SAML is a standard set by the OASIS [http://www.oasis open.org/committees/tc home.php?wg abbrev=security… …   Wikipedia

  • Security Assertion Markup Language — (SAML) is an XML based standard for exchanging authentication and authorization data between security domains, that is, between an identity provider (a producer of assertions) and a service provider (a consumer of assertions). SAML is a product… …   Wikipedia

  • Ошибка 404 — SSL Заголовки (список) Cookie · ETag · Referer · User Agent Коды состояния Код состояния англ. HTTP status code) является частью первой строки ответа сервера. Он представляет собой целое число из трех арабских цифр. Первая цифра указывает на… …   Википедия

  • Ошибка 403 — SSL Заголовки (список) Cookie · ETag · Referer · User Agent Коды состояния Код состояния англ. HTTP status code) является частью первой строки ответа сервера. Он представляет собой целое число из трех арабских цифр. Первая цифра указывает на… …   Википедия

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”