Programming Tips
Objects Referenced by UI Must Serializable
Objects that are referenced by an UI object, such as component and page, have to be serializable. Otherwise, they might have no value after de-serialized, or causes an exception (depending how it is used).
Attributes of UI Objects
If the value of an attribute is not serializable, it will be ignored. Thus, it will become null after de-serialized. Thus, it is better to make them all serializable (such as implementing java.io.Serializable), or handle the serialization manually (refer to the Clustering Listeners section below) .
zscript
It is OK, though not recommended, to use zscript in a clustering environment, but there are some limitations.
- BeanShell's function is not serializable. For example, the following won't work:
void foo() {
}
- The values of variables must be serializable
Notice that it is not recommended to use zscript in the clustering environment. After all, the performance of BeanShell is not good.
Event Listeners
Event listeners have to be serializable. Otherwise, it will be ignored after serialization.
Data Models
The data model, such as ListModel and ChartModel, have to be serializable. Otherwise, the UI object (such as grid) won't behave correctly. The implementations provided by ZK are serializable. However, the items to be stored in the data models have to be serializable too.
Composers
Clustering Listeners
Activation Listener for Non-Serializable Objects
Serialization Listeners for Customizing Serialization
Working Thread Cannot Last Two or More Requests
Version History
Version | Date | Content |
---|---|---|