Waffle was designed to provide default functionality that should be suitable for most any application. However in order to provide complete flexibility Waffle allows its foundational components to be over-written with custom implementations. As an example Waffle uses Ognl for data binding properties from a users request to the actions. It is easy to plug-in your own org.codehaus.waffle.bind.ControllerDataBinder by adding the following to the applications web.xml:
Similarly, to configure the servlet monitor to output to console:The param-name defines the interface of the component to be over-written and the param-value represents the implementing class. The following table lists the components that can currently be customized in Waffle (excluding Monitors):
Most application will never need to deal with any of these components. But it is nice to know that you can change any of the default behaviour if you so desire.
Waffle also allows you to plug-in your own custom components which don't need to extend or implement any Waffle components. This is easy to do by adding context-param's to your web.xml file. Notice the register: prefix in the param-name node below. When Waffle runs across such context-param it will register it for use in your application. You can also use the prefix registerNonCaching: for those components that should be instantiated new each time.
For a more concrete example Waffle defines the interface org.codehaus.waffle.bind.ValueConverter. Implementations of this interface allows you to write custom conversions for a specific class type. The following is an example of how you can register your converters with Waffle. Waffle's DefaultValueConverterFinder is dependent on all org.codehaus.waffle.bind.ValueConverter that are registered in the web.xml. So the following example will provide 2 custom converters for use in your application.