|
From: Darren D. <da...@da...> - 2004-03-03 02:05:06
|
=2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Is there any reason that all of the VelocityView.mergeTemplate(...) method= =20 can't be replaced with: template.merge(context, response.getWriter()); Certainly works well here from what I've been able to see, but I'm not=20 entirely sure of the implications. In particular I don't understand why=20 the VelocityServlet (which this code in mergeTemplate is from) authors=20 chose to do it the way they did. Perhaps it's legacy code that's just=20 never been revisited, or there's some enormous performance benefit from=20 modifying the output buffer size or using VelocityWriter..? Also, in VelocityEngineUtils.mergeTemplate(...) a new VelocityContext is=20 created from the model Map without verifying that model names are Velocity= =20 compliant (no periods(.)). VelocityView does this. Suggest moving the=20 relevant method from VelocityView to VelocityEngineUtils, making it static= =20 and having both classes call it. I've already got these changes locally so can commit them if there's no=20 objection. There's no impact on API, the existing test suite continues to= =20 pass and I've checked a couple of existing Velocity projects with it. Regards, =2D --=20 Darren Davison Public Key: http://www.davison.uk.net/key.jsp =2D----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFARTo/KLMLAN01aw0RArI1AKCh6KkQEUtmDSbd+H6YRZ7IrDoRAwCdGuwj wLF4sHO27a+97tJyroyXc3I=3D =3D3jy4 =2D----END PGP SIGNATURE----- |