|
Download
FAQ History |
|
API
Search Feedback |
Registering a Custom Converter
As is the case with a custom validator, if the application developer creates a custom converter, you must register it with the application. Here is the
converterconfiguration for theCreditCardConverterfrom the Duke's Bookstore application:<converter> <description> Registers the concrete Converter implementation, converters.CreditCardConverter using the ID, creditcard. </description> <converter-id>creditcard</converter-id> <converter-class> converters.CreditCardConverter </converter-class> </converter>The
converterelement represents aConverterimplementation and contains requiredconverter-idandconverter-classelements.The
converter-idelement identifies an ID that is used by theconverterattribute of a UI component tag to apply the converter to the component's data. Using a Custom Converter includes an example of referencing the custom converter from a component tag.The
converter-classelement identifies theConverterimplementation.Creating a Custom Converter explains how to create a custom converter.
|
Download
FAQ History |
|
API
Search Feedback |
All of the material in The J2EE(TM) 1.4 Tutorial is copyright-protected and may not be published in other works without express written permission from Sun Microsystems.