|
From: <jue...@we...> - 2003-12-11 19:16:18
|
Everybody, I'm not really happy with the helpers that VelocityView can expose. The = fixed naming "simpleDateFormat" and "currencyFormat" seems arbitrary and = is not in line with the way that AbstractView handles RequestContext = exposure. The latter defines a "requestContextAttribute" property that = can be set to the name that the RequestContext model attribute should = have, if any. 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? Juergen DI J=FCrgen H=F6ller Senior System Architect ______________________________________ werk3ATS - division systementwicklung werk3AT informations- und mediensysteme europaplatz 4 A - 4020 linz t. +43 (0) 732 71 65 29 502 f. +43 (0) 732 71 65 29 3 mailto:jue...@we... http://www.werk3at.com ______________________________________ werk3ATS - WIR ENTWICKELN ERFOLG |