Java 的 web 工具包,JWt 3.3.2 发布
JWt (Java Web Toolkit) 是一个用来开发交互式Web应用的Java工具包,参考桌面 GUI 的做法,主要面向网页 Widget 的开发。对开发人员而言,它提供了完整的Web规范的抽象层,基于事件机制对用户接口的数据更新进行处理。
Core library
- Supports major browsers (Firefox/Gecko, Internet Explorer, Safari, Chrome, Konqueror, and Opera) but also plain HTML browsers and web crawlers.
- Simple deployment in standard Java Servlet 2.4 or 3.0 containers.
- No need for IDE plugins: it's plain old Java.
- Equal behavior with or without support for JavaScript or Ajax, as far as possible, by using graceful degradation or progressive enhancement.
- Efficient rendering and low latency.
- Support for browser history navigation (back/forward buttons and bookmarks), pretty URLs with HTML5 History if available, and search engine optimization with a unified behavior for plain HTML or Ajax sessions.
- Widget centric API that promotes component reuse and increases productivity.
Event handling
- Uses an event listener system for server-side event handling, comparable to Java GUI frameworks (SWT, Swing).
- Listen for keyboard, mouse, focus, scroll or drag&drop events, and get event details (such as mouse position, modifier buttons, or keyboard key).
- Automatic synchronization Automatically synchronizes form field data from browser to server and tracks server-side changes to be rendered in browser.
- Integrate with JavaScript libraries
- Timed events and server-initiated updates ("server push"), the latter using Servlet 3.0 async features when deployed in a Servlet 3.0 container.
Native painting system
- Unified 2D painting API which uses the browsers native (vector) graphics support (inline VML, inline SVG, or HTML5 canvas), or renders to common image formats (PNG, GIF, ...) or vector formats (SVG, PDF).
- Unified GL-based 3D painting API which leverages WebGL in the browser or server-side OpenGL (fallback).
Built-in security
- Enables continuous use of HTTPS through low bandwidth requirements.
- Built-in Cross-Site Scripting (XSS) prevention. Rendered text is always filtered against potentially malicious code, making XSS attacks against JWt applications (close to) impossible.
- Not vulnerable to Cross-site Request Forgery (CSRF) because cookies are not needed for session tracking.
- Not vulnerable to breaking the application logic by skipping to a particular URL, since only those events exposed in the interface can be triggered.
Testing
With JWt, event handling code constructs and manipulates a widget tree, which can easily be inspected by test code. Therefore, a test environment allows your application to be instantiated and events to be simulated in absence of a browser, short-cutting the underlying request/response cycle that would otherwise require a simulated browser.Deployment
- Deploy into servlet containers (Tomcat, Jetty) and application servers (JBoss).
- Consists out of (currently four) jar files that need to be included in the IDE or used in war/ear archives.
- No XML, except for JEE's web.xml and message resource bundles.
JWt 3.3.2 发布,此版本更新内容如下:
推ter Bootstrap 3.1 is now supported in addition to version 2
A new WGLWidget was added, which implements GL-based 3D graphics, using either client-side WebGL or server-side OpenGL
The latter approach renders (using jogl) in an off-screen buffer, and can be used as a portable solution when WebGL is not available in the browser, or when scene complexity is so high that downloading the entire scene to a client is less efficient
A 3D Graphics Library was added to complement the existing 2D charting API
The wthttpd received several improvements from architectural changes, as well as performance improvements