Features

 

N.B. To ensure complete understanding of this topic we recommend you familiarize yourself with ZimCGI.

Compatibility with the ZimCGI

ZimWeb is, for the most part, upwards compatible with the ZimCGI, meaning that existing ZimCGI applications should not require much change to execute in the same manner with the ZimWeb .

 

The key difference is that ZimWeb requires you to have a TEMPLATE parameter- it is not optional (however see Parameter template can be specified for this procedure).

Ability to handle POST and GET requests

ZimWeb can accept parameters via either a POST request (as ZimCGI) or a GET request (with the parameters in the URL, which means you can bookmark a ZimWeb request or add a hyperlink).

Debug information

If you supply the parameter DEBUG in the request, you can see all sorts of useful details about the parameters, the http headers, etc. which can be very useful for debugging.

 

Since exposing the debugging information to any client may pose a security hazard, the ability to debug a request can be enabled and disabled by the application administrator.

HTTP session and cookie parameter management

N.B. When we refer to a client session, we are referring to the HTTP session, not the Zim agent session.

 

ZimWeb allows you to control and access client session and cookie parameters.

 

For example, your ZimWeb application could set the client session parameter PASSWORD to indicate a password that the user had supplied when they logged in. From that point, the parameter PASSWORD, if referenced in the TEMPLATE, would be supplied with that value, until the user exited their browser, the session timed out (which the application can control), or your application cleared the parameter or invalidated the session (i.e. they logged out from your Zim application).

Client session parameters do not cause the Zim agent session to remain open, so your Zim agents remain available between processing client requests.

 

Also, client session parameters are managed by the ZimWeb . and are not sent to the browser, which can be good from a security standpoint.

 

Similarly, your application could set a cookie parameter USERNAME to the user's name if, say, they check a "Remember me" box. Your application will then receive the USERNAME parameter, which can be a reference in the TEMPLATE, until the cookie expires (which the application can control) or the parameter is cleared.

In addition, ZimWeb allows you to specify that particular parameters which only comes from the HTTP session or cookies, by prefixing their names with the session or cookie respectively.

Access to key information about the request

ZimWeb exposes key information about the request as parameters which can be included in your TEMPLATE, these include:

Support for client authentication by different methods

ZimWeb provides support for client authentication in various different ways:

Control over the response

ZimWeb gives the Zim application control over the response sent back to the client, including the ability to:

Improved Zim session control

ZimWeb includes options to improve the security of, and to simplify the use of, persistent Zim sessions:

XML and XSLT support

If your Zim application generates XML output, then it can request that an XSLT style sheet is applied to that XML to generate what is sent to the client (web browser, cellphone, etc.).

 

Also, the web request can indicate that a particular style sheet is required, overriding the style sheet specified by the Zim application. It can even request that no style sheet is used, returning instead the raw XML.

 

XSLT stylesheets are automatically compiled and cached in memory for maximum performance. The web-based administration tool allows you to see which XSLT stylesheets are cached, and also enables you to clear the cache, forcing the stylesheets to be reloaded, which is useful if you have changed the stylesheets.

 

There is no upper limit on the XSLT stylesheet cache size - if you run out of memory through caching stylesheets then you haven't got enough memory to run your application efficiently.

Page template support

Some pages, particularly those designed by graphic artists etc., may not be covenient to turn into XSLT stylesheets (see XML and XSLT support).

 

ZimWeb includes page template support. A page template is just a regular page (HTML etc.), with parameter placeholders to indicate where each parameter to be supplied by the Zim application is to be placed. This template can be designed easily with your normal web page design tool.

 

The Zim application can then supply the parameters in an XML format. These parameters are combined with the template, with the result page being delivered to the client.

 

Just as with the XSLT processing, the templates are compiled into memory for maximum performance, and the request can specify an alternative, or even no page template.

XSL-FO support

ZimWeb includes XSL-FO support - this allows the Zim application to render XSL-FO (Formatting Objects) - usually the result of XSLT processing, though it can be from a page template or even the unprocessed Zim agent output - into Adobe Portable Document Format (PDF) or Rich Text Format (RTF), so the application can deliver typeset output directly to the client's browser.

Parameter template can be specifed for the procedure

When specifying which procedures can be run for a given connection, you can also specify the parameter template, eliminating the need the supply a TEMPLATE parameter with the request.

Improved Zim session control

The Zim application can directly control the termination of a Zim session - i.e. whether a Zim database agent is dedicated to a particular client, or is released when a request has been processed. This is very useful in preventing "denial-of-service" to the Zim web application by holding open every available Zim database agent.

 

Of course, the ZII's HTTP session and cookie parameter management eliminates much of the need to hold open the Zim session.

Ability to start ZimWeb automatically when Java servlet engine starts

By setting "load-on-startup" for the ZimWeb servlet configuration (the file web.xml if you are using Tomcat), ZimWeb will automatically start, and create all the Zim agent sessions, when the Java servlet engine starts.

 

Note: If the Zim Server is not available, the ZimWeb will start anyway, and you can start the Zim agent sessions when the Zim Server does become available with the Web-based administration tool.

Administration tools

ZimWeb has a web-based administration tool, which enables you to:

 

In addition, ZimWeb includes a utility which enables you to perform these functions from the command line or automatically in scripts, scheduled tasks, etc.