rules - Redirection Rules
Specifies rules for opening a page.
Category
basicsSyntax
<xe:this.rules>
<xe:redirectPhoneRule attributes>content</xe:redirectPhoneRule> |
<xe:redirectTabletRule attributes>content</xe:redirectTabletRule> |
<xe:redirectHeaderRule attributes>content</xe:redirectHeaderRule> |
<xe:redirectCustomRule attributes>content</xe:redirectCustomRule>
...
</xe:this.rules>
Property | Description |
---|---|
disableRequestParams="true|false" |
Disables the copying of request parameters into the URL for the target page. Defaults to false. |
|
Extra parameters appended to the target URL. |
header="User-Agent | Accept" |
(xe:redirectHeaderRule only)
Request header to match against headerPattern . Defaults
to User-Agent . |
headerPattern="regexp" |
(xe:redirectHeaderRule only)
Request header pattern as a regular expression if type is custom . |
loaded="true|false" |
Whether the tag instance should be created when the page is loading. Defaults to true. |
url="page.xsp" |
Target URL, typically the name of an XPage with
the extension .xsp . |
urlHash="hash" |
A string prefixed with # and
appended to url for specifying mobile pages like #document and #topic . |
Usage
In Design mode, click All Properties and look for rules under basics.The
first matching rule determines the target page:
redirectPhoneRule
(Redirect Phone Rule) redirects to another page when the browser is on a mobile device.redirectTabletRule
(Redirect Tablet Rule) redirects to another page when the browser is on a tablet device.redirectHeaderRule
(Redirect Header Rule) redirects to another page when a header matches a specified pattern.redirectCustomRule
(Redirect Custom Rule) redirects to another page when theredirect
property evaluates to true.
Examples
This example redirects the current page tomobile.xsp#document
if the requesting device
is a mobile phone or tablet.<xe:redirect>
<xe:this.rules>
<xe:redirectPhoneRule
url="mobile.xsp" urlHash="document" disableRequestParams="false">
</xe:redirectPhoneRule>
<xe:redirectTabletRule
url="mobile.xsp" urlHash="document" disableRequestParams="false">
</xe:redirectTabletRule>
</xe:this.rules>
</xe:redirect>