The error-reload Element"
m (remove 301 sample to avoid misunderstanding) |
m (correct highlight (via JWB)) |
||
Line 13: | Line 13: | ||
[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, < | + | It specifies what URI to redirect the browser to. For example, if you prefer to redirect to the login page, say, <code>login.zul</code>, you can specify the following in zk.xml: |
<source lang="xml" > | <source lang="xml" > | ||
Line 35: | Line 35: | ||
[Since 3.6.3] | [Since 3.6.3] | ||
− | Specifies the connection type. It can be either < | + | Specifies the connection type. It can be either <code>au</code> or <code>server-push</code>. By default, it is <code>au</code> 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 < | + | If you want to specify the error page for the server push (comet-based), you have to specify <code>server-push</code> as shown in the example [[#error-code | below]] |
== device-type == | == device-type == | ||
Line 44: | Line 44: | ||
[Since 3.6.3] | [Since 3.6.3] | ||
− | Specifies the device type. By default, it is < | + | Specifies the device type. By default, it is <code>ajax</code>. If you want to configure for ZK Mobile, use <code>mil</code>. |
== error-code == | == error-code == | ||
Line 67: | Line 67: | ||
Specifies the URI to reload if the specified error occurs. | Specifies the URI to reload if the specified error occurs. | ||
− | If the content of < | + | If the content of <code>reload-uri</code> is empty, the browser simply reloads the same page again. |
<source lang="xml" > | <source lang="xml" > | ||
Line 73: | Line 73: | ||
</source> | </source> | ||
− | If you want to show an error message instead, specify < | + | If you want to show an error message instead, specify <code>false</code>. |
<source lang="xml" > | <source lang="xml" > |
Revision as of 10:18, 19 January 2022
Syntax:
<error-reload> [<device-type>deviceType|ajax</device-type>] <error-code>an_error_code</error-code> <reload-uri>an_uri</reload-uri> [<connection-type>server-push|au</connection-type>] </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>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 Allowed: au, server-push [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
Version | Date | Content |
---|---|---|