Tag Libraries
WebWork has an extensive tag library that is used in rendering output to the users. Most of the tags in WebWork are built to support JSP pages, velocity templates, and FreeMarker templates. However there are some tags that are specific to the one of the above languages and cannot be used universally. Though WebWork supports all three languages listed above, it gives additional emphasis for FreeMarker and encourages developers to use FreeMarker instead of JSP and velocity.
Tags in WebWork can be broadly classified as general tags and HTML tags. General tags are used to manipulate the general flow of the user interface pages and allow the developer to add conditional logic into them. Built-in tags, like if-else, iterator, and sort, can help control the output to the user interface. Other general tags allow the developer to create new beans, set and get properties on beans, push values on to the stack, and support internationalization. HTML tags help the programmer to access data and display them in HTML to the user interface. Apart from having representations for the common HTML controls, HTML tags have additional representations for commonly used UI functions. HTML tags are extensively used as part of templates and themes.
OGNL
Object Graph Navigation Language (OGNL) is an expression language used to access properties of Java objects. WebWork uses OGNL to access data in Java objects and servlet variables. OGNL allows the developer to access servlet variables that are in session scope, application scope, and request scope. Unlike simple tags, OGNL also allows the developer to evaluate expressions before they are rendered to the user interface.
Themes and Templates
One of the important features of WebWork is its support for themes and templates. Templates are small pieces of code written in FreeMarker, JSP, or velocity that are rendered to the UI using HTML tag libraries and themes are a collection of templates that are combined together to provide some common functionality. WebWork has a number of templates written in FreeMarker, but developers are free to build new templates in JSP or velocity. Template engines for JSP and velocity templates are included in WebWork, but WebWork recommends using FreeMarker templates instead. WebWork also has a set of built-in themes that can be used for most UI rendering schemes, and developers also have the flexibility to extend from existing themes or built new themes. WebWork comes packaged with a simple theme, an xhtml theme, and a css-xhtml theme. It is recommended that you use one of these themes or extend the simple theme rather than build a new theme from scratch
Type Conversion
HTTP parameters are usually received and transmitted as strings without any type information defined in them. A field could be an integer, a currency, a data, or a double, but when it is transmitted over HTTP, all of them are converted to strings. It is the responsibility of the receiving application (an action or a controller, etc.) to parse the information into the right data type. WebWork provides a simple conversion library that can convert request parameters into common data types like integer, long, double, array, dates, etc. It can convert these data types back into strings before they are transmitted. Apart from these inbuilt conversions, WebWork allows users to define their own data types and do conversions. For example, suppose you enter the height of a person in feet and inches. The information can be passed as "5,11" and the converter can parse the string to generate a Height object with feet and inches as separate fields.
New on the Java Boutique:
New Review:
Time Management Made Easy with the Quartz Enterprise Job Scheduler
Why not just use the Java timer API? This open source scheduling
API boasts simplicity, ease-of-integration, a well-rounded feature
set, and it's free!
New Applet:
Reverse Complement
Reverse Complement is a simple applet that converts DNA or RNA
sequences into three useful formats.
Elsewhere on internet.com:
WebDeveloper Java
Lots of Java information on webdeveloper.com
WDVL Java
Thorough Java resource at the Web Developer's Virtual Library.
ScriptSearch Java
Hundreds of free Java code files to download.
jGuru: Your View of the Java Universe
Customizable portal with online training, FAQs, regular news updates, and tutorials.