You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

WebWork has one of the most advanced type conversion abilities in any web-based framework in any Java language. Generally, you don't need to do anything to take advantage of it, other than name your HTML inputs (form elements and other GET/POST parameters) names that are valid OGNL expressions.

A Simple Example

Error formatting macro: snippet: java.lang.NullPointerException
Error formatting macro: snippet: java.lang.NullPointerException

WebWork ships with a helper base class that makes converting to and from Strings very easy. The class is com.opensymphony.webwork.util.WebWorkTypeConverter. This class makes it very easy for you to write type converters that handle converting objects to Strings as well as from Strings. From the JavaDocs for this class:

Error formatting macro: snippet: java.lang.NullPointerException

Built in Type Conversion Support

Error formatting macro: snippet: java.lang.NullPointerException

Relationship to Parameter Names

Advanced Type Conversion

Null Property Handling

Error formatting macro: snippet: java.lang.NullPointerException
Error formatting macro: snippet: java.lang.NullPointerException

Collection and Map Support

Type Conversion Error Handling

  • No labels