Redirect Snippet

Once the snippet is added to a page, if you come back to that page in "view" mode you will be automatically sent to the page defined between the brackets.

Examples

Basic Redirects

  • Send the user to an external website
$response.sendRedirect("http://www.w3.org")

  • Send the user to another page on the wiki
$response.sendRedirect($xwiki.getURL('Some.Document'))

  • Send the user to another page on the wiki, in edit mode
$response.sendRedirect($xwiki.getURL('Some.Document', 'edit'))

  • Send the user directly to the edit mode of the page viewed
$response.sendRedirect($doc.getURL('edit'))

Advanced Redirects

  • Show the same page to the user but without applying the skin
$response.sendRedirect($doc.getURL('view', 'xpage=plain'))

  • Show the same page in wiki markup language but without applying the skin
$response.sendRedirect($doc.getURL('view', 'xpage=wml'))

  • Send to the same page but using a xml representation and without applying the skin
$response.sendRedirect($doc.getURL('view', 'xpage=xml'))

  • Send to a page to get a RSS Feed (need further explanation)
$response.sendRedirect($xwiki.getURL('Some.Document', 'view', 'xpage=rdf'))
Version 2.1 last modified by VincentMassol on 09/12/2007 at 14:51

Comments 0

No comments for this document

Attachments 0

No attachments for this document

Creator: GuillaumeLerouge on 2007/04/07 21:16
This wiki is licensed under a Creative Commons license
1.4.1.10194