|
From: Darren D. <dda...@kg...> - 2003-12-12 09:07:07
|
> Similarly, VelocityView could have "dateFormatAttribute" and > "currencyFormatAttribute" properties to allow for specifying the > names of those attributes, instead of fixed names and boolean > "exposeDateFormatter" respectively "exposeCurrencyFormatter" flags. > We could also add an additional "numberFormatAttribute" property, > for a plain NumberFormat instance. > > Alternatively, we could also scrap the helper exposure altogether > and leave that to subclasses, or find some way to associate such > model objects as static attributes - maybe via AbstractView's > "attributesMap" that can take bean references too? The latter would > involve setting up DateFormat and NumberFormat instances as beans, > linking them in as model attributes via bean references. > > After all, Velocity should really support such formatting itself - > it is really weak in that respect. The JSTL's "fmt" tag library does > that in a nice way for JSPs... Why does it have to be so complicated > with Velocity? Finally, how are VelocityView users doing this > currently? Is anyone using our exposure of pre-defined helpers or do > you use your own mechanisms? we're using the date format helper, simply because it was there - I'm not particularly precious about it. Supplying the helpers as beans defined in a context seems the more 'Spring-centric' way to go, however the helpers currently use static factory methods that take a locale parameter from the current request - can that still be handled? As long as there's no loss of functionality, I'm +1 for anything! -- Darren Davison Public Key: http://www.davison.uk.net/key.jsp |