The org.zkoss.zk.ui.util.RequestInterceptor interface"
From Documentation
m |
|||
Line 1: | Line 1: | ||
{{ZKConfigurationReferencePageHeader}} | {{ZKConfigurationReferencePageHeader}} | ||
− | ''' | + | |
− | org.zkoss.zk.ui.util.RequestInterceptor | + | '''Listener:''' |
− | <javadoc type="interface">org.zkoss.zk.ui.util.RequestInterceptor</javadoc> | + | org.zkoss.zk.ui.util.RequestInterceptor |
+ | |||
+ | A listener could implement <javadoc type="interface">org.zkoss.zk.ui.util.RequestInterceptor</javadoc> to intercept each request made to ZK Loader and ZK Update Engine. Once registered, an instance of the specified class is created and shared within the whole application. Then, the <tt>request</tt> method is invoked, each time a request is received by ZK Loader or ZK Update Engine. | ||
A typical use of this interface is to determine the locale and/or time zone of the request. Please refer to [[ZK Developer's Reference/Internationalization|ZK Developer's Reference]] for the details of Internationalization. | A typical use of this interface is to determine the locale and/or time zone of the request. Please refer to [[ZK Developer's Reference/Internationalization|ZK Developer's Reference]] for the details of Internationalization. |
Revision as of 06:21, 20 April 2011
Listener:
org.zkoss.zk.ui.util.RequestInterceptor
A listener could implement RequestInterceptor to intercept each request made to ZK Loader and ZK Update Engine. Once registered, an instance of the specified class is created and shared within the whole application. Then, the request method is invoked, each time a request is received by ZK Loader or ZK Update Engine.
A typical use of this interface is to determine the locale and/or time zone of the request. Please refer to ZK Developer's Reference for the details of Internationalization.
You can register any number of the request interceptors (RequestInterceptor).
Note:
- Unlike ExecutionInit and many other listeners, an instance of the registered RequestInterceptor is created at the time of registration, and then it is shared by the whole application. Thus, you have to make sure it can be accessed concurrently.
- The request parameters will be parsed with the proper locale and character encoding, after the RequestInterceptor.request(Session, Object, Object) method is called. It is not recommended to call the getParameter or getParameterValues methods (of javax.servlet.ServletRequest) in this method.