Server-side API and client-side API

The APIs for developing applications using the DHTML client in DB2 Alphablox are available on the server-side, where a developer accesses them through Java™ calls (for example, in a Java scriptlet on a JSP page). The reason the Java APIs are called server-side APIs is because the code executes on the server before it is sent to the browser.

Executing code on the server is often more efficient, and also makes it easier to create web pages that work correctly on multiple browsers. The DHTML client is designed to keep the client and the server in sync without page refreshing. When you execute code on the server, only affected areas in the Blox UI is refreshed, not the whole page.

There are also times when you want to use the DHTML client’s Client API for tasks that are best handled on the client. These are called client-side APIs because they are interpreted by the browsers. Often times you want to call some server-side code to change Blox properties on the server via some JavaScript™ code on the client when a user clicks a button or link on the page.

The DHTML client has a relatively straightforward API on the client-side.