The error-page Element"

From Documentation
(Created page with '== The error-page Element == <source lang="xml" > <error-page> <device-type>['''ajax'''|mil]</device-type> <exception-type>''ClassName''</exception-type> <locati…')
 
 
(12 intermediate revisions by 5 users not shown)
Line 1: Line 1:
== The error-page Element ==
+
{{ZKConfigurationReferencePageHeader}}
 +
 
 +
 
 +
'''Syntax:'''
  
<source lang="xml" >
 
 
  <error-page>
 
  <error-page>
     <device-type>['''ajax'''|mil]</device-type>
+
     <device-type>''a_device_type|'''ajax'''</device-type>
     <exception-type>''ClassName''</exception-type>
+
     <exception-type>''a_class_name''</exception-type>
     <location>''the error page's URI''</location>
+
     <location>''a_uri''</location>
 
  </error-page>
 
  </error-page>
 +
 +
It specifies an error page used when an uncaught exception is thrown in updating a ZUML page (e.g., in an event listener). Each page is associated with an exception type, a class deriving from <code>java.lang.Throwable</code>. You can specify multiple error pages, each with a different exception type. When an error occurs, ZK searches the proper error page by examining the exception types individually. If none is found, it will show an alert message to the client by default.
 +
 +
The <code>device-type</code> element is optional. If omitted, <code>ajax</code> is assumed.
 +
 +
For example,
 +
 +
<source lang="xml" >
 +
<error-page>
 +
<exception-type>java.lang.Throwable</exception-type>
 +
<location>/WEB-INF/sys/error.zul</location>
 +
</error-page>
 
</source>
 
</source>
 
It specifies an error page used when an un-caught exception is thrown in updating a ZUML page (e.g., in an event listener). Each page is associated with an exception type, aka, a class deriving from <tt>java.lang.Throwable</tt>. You can specify multiple error pages, each with a different exception type. When an error occurs, ZK searches the proper error page by examing the exception type one-by-one. If none is found, it shows, by default, an alert message at the client.
 
  
The <tt>device-type</tt> element is optional. If omitted, <tt>ajax</tt> is assumed. If you want to specify an error page for mobile devices, it has to be <tt>mil</tt>.
+
For more information, please refer to [[ZK Developer's Reference/UI Patterns/Error Handling|ZK Developer's Reference: Error Handling]].
 +
 
 +
=Acceptable Path =
 +
You can specify one of the following paths:
 +
# Web URLs. http://example.com/
 +
# Classpath Web Resource Paths. <code>~./error.zul</code>
 +
# Servlet Context Paths. <code>/WEB-INF/error.zul</code> or <code>/mypath/error.zul</code>
 +
# Filesystem Path. <code>/var/resources/error.zul</code>
 +
<!-- ResourceCaches.get() -->
 +
 
 +
{{ZKConfigurationReferencePageFooter}}

Latest revision as of 08:23, 3 January 2024


The error-page Element



Syntax:

<error-page>
    <device-type>a_device_type|ajax</device-type>
    <exception-type>a_class_name</exception-type>
    <location>a_uri</location>
</error-page>

It specifies an error page used when an uncaught exception is thrown in updating a ZUML page (e.g., in an event listener). Each page is associated with an exception type, a class deriving from java.lang.Throwable. You can specify multiple error pages, each with a different exception type. When an error occurs, ZK searches the proper error page by examining the exception types individually. If none is found, it will show an alert message to the client by default.

The device-type element is optional. If omitted, ajax is assumed.

For example,

	<error-page>
		<exception-type>java.lang.Throwable</exception-type>
		<location>/WEB-INF/sys/error.zul</location>
	</error-page>

For more information, please refer to ZK Developer's Reference: Error Handling.

Acceptable Path

You can specify one of the following paths:

  1. Web URLs. http://example.com/
  2. Classpath Web Resource Paths. ~./error.zul
  3. Servlet Context Paths. /WEB-INF/error.zul or /mypath/error.zul
  4. Filesystem Path. /var/resources/error.zul



Last Update : 2024/01/03

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