[ You are here:
XTF ->
Tag Reference -> Redirecting to Another URL ]
Redirecting to Another URL
XTF provides an extension element that immediately redirects the user's browser to a different URL, suppressing further processing of the formatting stylesheet. See the
XTF Programming Guide for a description and example.
HTTP Redirection Extension
This element can be used inside any parsing or formatting stylesheet in XTF like this:
<redirect:send url="TargetURL"
xmlns:redirect="java:/org.cdlib.xtf.saxonExt.Redirect"
xsl:extension-element-prefixes="redirect"/>
where
url="TargetURL" |
is a required attribute specifying the URL that the user's browser should be redirected to. An absolute or relative URL may be specified. If relative, the URL will be resolved by the servlet container to an absolute URL. |
redirect: |
is a namespace prefix identifying this Saxon extension instruction. The namespace URI for this prefix must be: java:/org.cdlib.xtf.saxonExt.Redirect . In addition, it must be declared in the list of extension-element-prefixes for Saxon. The declarations are most easily done in-line as shown above. |
This extension element causes an immediate HTTP redirect (code 302) to be sent to the user's browser. Further processing of the stylesheet is aborted.
No prior output is allowed before this extension instruction is executed. If any output was generated, an exception will be thrown and the redirect will fail.