Wt (web toolkit)
Wt 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.
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 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
- The only server-side framework implementing the strategy of progressive enhancement automatically;
- The only Ajax framework with search engine optimization qualities.
Major features
- Automatic graceful degradation and progressive enhancement
- Supports server-initiated events
- A unified rendering API
- Client- and server-side validation
- Contains various security features to avoid Cross-site scripting and Cross-site request forgery vulnerabilities
- Includes a compact C++ ORM-layer
- Uses the WebSocket networking protocol, if available, for Client–server model of communication, with fallbacks to Ajax or plain web page rendering
Code example
The "Hello, World!" program in Wt:- include
- include
- include
- include
- include
- include
* A simple hello world application class which demonstrates how to react
* to events, read input, and give feed-back.
*/
class HelloApplication : public Wt::WApplication
/*
* The env argument contains information about the new session, and
* the initial request. It must be passed to the WApplication
* constructor so it is typically also an argument for your custom
* application constructor.
- /
: WApplication
void HelloApplication::greet
int main