Wt 3.1.6, JWt 3.1.6

  • Posted by koen
  • Friday, October 29, 2010 @ 21:39

A new version of the library packed with lots of bug fixes and a fair share of new features.

The highlights of this release are:

JWt: Servlet API 3.0 (asynchronous) support.

This version of JWt will use the Servlet 3.0 asynchronous I/O capabilities when deployed in a Servlet 3.0 container (such as Tomcat 7.04 BETA).

Asynchronous processing enables two exciting features, finally closing the gap between the feature set of C++ and Java Wt:

Server-initiated updates

A call to WApplication.enableUpdates() will enable server-initiated updates (aka "server-push"). This is the classic use-case for asynchronous I/O: it allows one to postpone the reply to a request while not blocking threads and thus scale with many active connections.

Using server-side events is entirely straight forward in Wt: once enabled, you can update the user-interface outside of the regular event loop, and then push these changes to the browser. You can even use this only temporarily, e.g. during a file upload (which is used by the library itself to implement a progress bar during file uploads, see below).

Our next step in server-side events is going to be more or less a performance optimization from your point of view: to use WebSockets where available, instead of XMLHttpRequest.

Recursive event-loops

This allows to wait at the server for a response from the client, blocking the current thread (i.e. reverse the request/response relation between browser and server). This is convenient to show (typically modal) dialogs, messages boxes, popup menus, and wait for their result to decide what to do next:

StandardButton result = WMessageBox.show("Confirm", "This will delete all files, Okay ?",
                                          StandardButton.Ok, StandardButton.Cancel);

if (result == StandardButton.Ok) {
    // proceed rm -rf
}
JWt: WebGraphics2D

This utility class aids in porting over existing Swing code-bases to the web: it allows one to paint a javax.swing.JComponent (or anything else that paints itself on a java.awt.Graphics to JWt.

You may want to read up on our experience to convert a Java applet to JWt using this utility class, reusing the existing rendering code.

WFileUpload improvements

We’ve made several improvements to the file upload widget, including support for uploading multiple files, a progress bar, and (for C++ Wt), return 413 status code when the request exceeds the maximum request size.

IE9 support

Microsoft Internet Explorer 9 is probably the most promising effort so far of Microsoft to implement a developer-friendly browser. Not only promises it to fix many bugs and quirks of previous version of IE (including IE7 and IE8!) but it also implements an already healthy subset of HTML5, which can be used by Wt.

Although the browser is currently still in Beta, and only expected Q2 of 2011, we have added support for it by either disabling workarounds that were needed for older browsers, and by using modern HTML5 features when possible (like <canvas>, <video>, …).

Two new widgets: WProgressBar and WSpinBox

Last but not least, two new widgets were implemented: a progress bar and a spin box.

Tags:
0 comments

Contact us for more information
or a personalised quotation