Java Servlet Programming, 2nd Edition > 15. WebMacro > 15.6 Filters |
15.6 FiltersAt the time of this writing, WebMacro has just opened up its development process to a wider audience and moved from the relatively restrictive GPL license to the less restrictive Apache-style license. As a result of the increased developer resources, many interesting and useful enhancements are now in the works. The most substantial enhancement involves a pluggable filter mechanism. The idea is for a variable to go through a filter when output, with the filter controlling how the variable is displayed. Standard filters are likely to perform:
15.6.1 Custom FiltersCustom filters hold particular promise. For example, a customer variable could be filtered through a customer template designed to render the variable and its properties based on an external template file. The customer template might even filter the customer's address through an external address template. This allows easy reuse and customization of display logic. Filters may support being chained as well. That would allow, for example, a variable to be both localized and escaped, with a predetermined output value should the variable be null. The possible uses for filters are still purely in people's imaginations. It will be interesting to see what uses for WebMacro filters actually become popular.
|