Wt (pronounced ''"witty"'') is an
open-source
Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use the source code, design documents, or content of the product. The open-source model is a decentralized sof ...
widget-centric
web framework for the
C++ programming language. It has an
API resembling that of
Qt framework (although it was developed with Boost, and is incompatible when mixed with Qt), also using a widget-tree and an
event-driven signal/slot system.
The Wt's design goal is to benefit from the
stateful
In information technology and computer science, a system is described as stateful if it is designed to remember preceding events or user interactions; the remembered information is called the state of the system.
The set of states a system can oc ...
component model used in desktop-applications APIs, applied to
web development
Web development is the work involved in developing a website for the Internet (World Wide Web) or an intranet (a private network). Web development can range from developing a simple single static page of plain text to complex web applications ...
—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
In software engineering, a software development process is a process of dividing software development work into smaller, parallel, or sequential steps or sub-processes to improve design, product management. It is also known as a software devel ...
, it does support some
web
Web most often refers to:
* Spider web, a silken structure created by the animal
* World Wide Web or the Web, an Internet-based hypertext system
Web, WEB, or the Web may also refer to:
Computing
* WEB, a literate programming system created by ...
-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 agent
In computing, a user agent is any software, acting on behalf of a user, which "retrieves, renders and facilitates end-user interaction with Web content". A user agent is therefore a special kind of software agent.
Some prominent examples of us ...
s. 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
A framework is a generic term commonly referring to an essential supporting structure which other things are built on top of.
Framework may refer to:
Computing
* Application framework, used to implement the structure of an application for an op ...
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
A performance is an act of staging or presenting a play, concert, or other form of entertainment. It is also defined as the action or process of carrying out or accomplishing an action, task, or function.
Management science
In the work place ...
.
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
Security is protection from, or resilience against, potential harm (or other unwanted coercive change) caused by others, by restraining the freedom of others to act. Beneficiaries (technically referents) of security may be of persons and social ...
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
A "Hello, World!" program is generally a computer program that ignores any input and outputs or displays a message similar to "Hello, World!". A small piece of code in most general-purpose programming languages, this program is used to illustra ...
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.
*/
HelloApplication::HelloApplication(const Wt::WEnvironment& env)
: WApplication(env)
void HelloApplication::greet()
int main(int argc, char **argv)
See also
*
Comparison of web-frameworks
*
JWt (Java web toolkit)
JWt (pronounced "jay-witty") is an open-source widget-centric web application framework for the Java programming language developed by Emweb. It has an API that uses established GUI application development patterns. The programming model is comp ...
, a native
Java version of Wt
*
Other C++ web frameworks
References
External links
{{DEFAULTSORT:Wt - Web Toolkit
Web frameworks
Rich web application frameworks
Web development software
Ajax (programming)
Web server software