The error-reload Element"

From Documentation
(Created page with ' {{ZKConfigurationReferencePageHeader}} == The error-reload Element == [Default: show an error message] It specifies what URI to redirect the browser to. For example, if you …')
 
m
Line 1: Line 1:
 +
{{ZKConfigurationReferencePageHeader}}
  
  {{ZKConfigurationReferencePageHeader}}
+
'''Syntax:'''
 +
  <error-reload>
 +
    <device-type>''deviceType''|'''ajax'''</device-type>
 +
    <error-code>''an_error_code''</error-code>
 +
    <reload-uri>''an_uri''</reload-uri>
 +
</error-reload>
  
== The error-reload Element ==
 
 
  [Default: show an error message]
 
  [Default: show an error message]
  
 
It specifies what URI to redirect the browser to. For example, if you prefer to redirect to the login page, say, <tt>login.zul</tt>, you can specify the following in zk.xml:
 
It specifies what URI to redirect the browser to. For example, if you prefer to redirect to the login page, say, <tt>login.zul</tt>, you can specify the following in zk.xml:
 
  
 
<source lang="xml" >
 
<source lang="xml" >
Line 27: Line 31:
 
</source>
 
</source>
  
<blockquote>
+
== connection-type ==
 
 
=== connection-type ===
 
 
  Optional
 
  Optional
 
  Default: au
 
  Default: au
Line 37: Line 39:
  
 
If you want to specify the error page for the server push (comet-based), you have to specify <tt>server-push</tt> as shown in the example [[#error-code | below]]
 
If you want to specify the error page for the server push (comet-based), you have to specify <tt>server-push</tt> as shown in the example [[#error-code | below]]
=== device-type ===
+
== device-type ==
 
  Optional
 
  Optional
 
  Default: ajax
 
  Default: ajax
Line 44: Line 46:
 
Specifies the device type. By default, it is <tt>ajax</tt>. If you want to configure for ZK Mobile, use <tt>mil</tt>.
 
Specifies the device type. By default, it is <tt>ajax</tt>. If you want to configure for ZK Mobile, use <tt>mil</tt>.
  
=== error-code ===
+
== error-code ==
 
  Required
 
  Required
  
Line 60: Line 62:
 
</source>
 
</source>
  
=== reload-uri ===
+
== reload-uri ==
 
  Required
 
  Required
  
Line 76: Line 78:
 
  <reload-uri>false</reload-uri>
 
  <reload-uri>false</reload-uri>
 
</source>
 
</source>
</blockquote>
 
 
  
{{ZKConfigurationReferencePageFooter}}
+
=Version History=
 +
{{LastUpdated}}
 +
{| border='1px' | width="100%"
 +
! Version !! Date !! Content
 +
|-
 +
| &nbsp;
 +
| &nbsp;
 +
| &nbsp;
 +
|}
 +
{{ZKConfigurationReferencePageFooter}}

Revision as of 11:46, 3 December 2010


The error-reload Element


Syntax:

<error-reload>
    <device-type>deviceType|ajax</device-type>
    <error-code>an_error_code</error-code>
    <reload-uri>an_uri</reload-uri>
</error-reload>
[Default: show an error message]

It specifies what URI to redirect the browser to. For example, if you prefer to redirect to the login page, say, login.zul, you can specify the following in zk.xml:

 <error-reload>
     <device-type>ajax</device-type>
     <error-code>301</error-code>
     <reload-uri>/login.zul</reload-uri>
 </error-reload>
 <error-reload>
     <device-type>ajax</device-type>
     <error-code>402</error-code>
     <reload-uri>/login.zul</reload-uri>
 </error-reload>
 <error-reload>
     <device-type>ajax</device-type>
     <error-code>410</error-code>
     <reload-uri>/timeout.zul</reload-uri>
     <connection-type>server-push</connection-type>
 </error-reload>

connection-type

Optional
Default: au
[Since 3.6.3]

Specifies the connection type. It can be either au or server-push. By default, it is au which are the Ajax reqests sent by the widgets running at the client.

If you want to specify the error page for the server push (comet-based), you have to specify server-push as shown in the example below

device-type

Optional
Default: ajax
[Since 3.6.3]

Specifies the device type. By default, it is ajax. If you want to configure for ZK Mobile, use mil.

error-code

Required

Specifies the error code, aka., the server status code; see RFC 2068.

For server-push (comet-based), there is an important error code called 410. It is received when the session is timeout (or the serve is restarted). If you want to notify user about this, you can specify something similar to the following.

<error-reload>
	<device-type>ajax</device-type>
	<error-code>410</error-code>
	<reload-uri>/timeout.zul</reload-uri>
	<connection-type>server-push</connection-type>
</error-reload>

reload-uri

Required

Specifies the URI to reload if the specified error occurs.

If the content of reload-uri is empty, the browser simply reloads the same page again.

 <reload-uri></reload-uri>

If you want to show an error message instead, specify false.

 <reload-uri>false</reload-uri>

Version History

Last Update : 2010/12/03


Version Date Content
     


Last Update : 2010/12/03

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.