Girish Mahajan (Editor)

Wt (web toolkit)

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit
Original author(s)
  
Emweb

Operating system
  
Any

Written in
  
C++

Type
  
Web framework

Initial release
  
1.0.0 / Released December 2005

Stable release
  
3.3.6 / July 15, 2016; 8 months ago (2016-07-15)

Wt (pronounced "witty") is an open-source widget-centric web framework for the C++ programming language. It has an API resembling that of Qt framework, also using a widget-tree and an event-driven signal/slot system.

Contents

The Wt's design goal is to benefit from the stateful component model used in desktop-applications APIs, applied to web development—instead of the traditional MVC (model–view–controller) design pattern. So rather than using MVC at the level of a web page, it is pushed to the level of individual components.

While the library uses a desktop software development process, it does support some web-specific features, including:

  • Semantic URLs
  • Navigation of browser's history
  • One of the unique features of Wt is its abstraction layer of the browser rendering model. The library uses Ajax for communicating with browsers compatible with it, while using plain HTML-form post-backs for other user agents. Using a progressive bootstrap-method, the user interface is rendered as a plain HTML document first, then, provided its support in browser, it is automatically upgraded to use Ajax for increased interactivity. In this way, Wt is by definition:

  • The only server-side framework implementing the strategy of progressive enhancement automatically;
  • The only Ajax framework with search engine optimization (SEO) qualities.
  • Because of the popularity of C/C++ in embedded system environments, Wt is often used in such devices and (as a consequence) has been highly optimized for performance.

    Major features

  • Automatic graceful degradation and progressive enhancement
  • Supports server-initiated events (Comet)
  • A unified rendering API (SVG, the HTML5 canvas element, VML)
  • Client- and server-side validation
  • Contains various security features to avoid Cross-site scripting and Cross-site request forgery (CSRF) vulnerabilities
  • Includes a compact C++ ORM-layer ("Wt::Dbo")
  • Uses the WebSocket networking protocol, if available, for Client–server model of communication, with fallbacks to Ajax or plain web page rendering
  • For a more detailed overview, see the Features section of official website.

    Code example

    The "Hello, World!" program in Wt:

    References

    Wt (web toolkit) Wikipedia