JWt (Java web toolkit)

JWt
Original author(s) Emweb
Initial release 1.0.0 / Released December 2005
Stable release
3.3.6 / July 15, 2016 (2016-07-15)[1]
Written in Java
Operating system Any
Type Web application framework
License Dual License: GNU General Public License or Commercial License
Website www.webtoolkit.eu/jwt

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 component-based and event-driven, similar to Swing.

The goal of the library is to benefit from the stateful component model used in desktop applications APIs, applied to web development, instead of the traditional model–view–controller (MVC) model. Rather than using MVC at the level of a page, MVC is pushed to the level of individual components.

While the library uses a desktop application development model, it does support web-specific features including semantic URLs, browser history navigation support, internationalization, themes and styling, ...

A unique feature of the library is its abstraction layer of the browser rendering model. The library uses Ajax for communicating with Ajax-capable browsers, while using plain HTML form post-backs for other user agents (for accessibility and search engines). Using a progressive bootstrap method, the user interface is initially rendered as plain HTML, and for Ajax-capable browsers, it is automatically upgraded to use Ajax for increased interactivity. In this way, it is the only server-side framework that implements progressive enhancement automatically, and the only Ajax framework with search engine optimization (SEO) qualities.

JWt is distributed as a jar file. A JWt application is a war file that is deployed in a standards-compliant servlet container.

Major features

See the feature list on the project homepage for a more detailed overview.

Code example

The Hello World! example full source code

/*
 * A simple hello world application class which demonstrates how to react
 * to events, read input, and give feed-back.
 */
public class HelloApplication extends WApplication {
    public HelloApplication(WEnvironment env) {
        super(env);
      
        setTitle("Hello world");

        getRoot().addWidget(new WText("Your name, please ? "));
        final WLineEdit nameEdit = new WLineEdit(getRoot());
        nameEdit.setFocus();

        WPushButton button = new WPushButton("Greet me.", getRoot());
        button.setMargin(5, Side.Left);

        getRoot().addWidget(new WBreak());

        final WText greeting = new WText(getRoot());

        button.clicked().addListener(this, new Signal.Listener() {
            public void trigger() {
                greeting.setText("Hello there, " + nameEdit.getText());
            }
        });
  }
}

See also

References

External links

This article is issued from Wikipedia - version of the 7/18/2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.