|
From: Cameron B. <ca...@da...> - 2004-03-09 13:58:33
|
Yeah.. The shared varible system works. Wrapping a map in a simple hash =
is
the same technique that I have used elsewhere.=20
For the time being I will only be using the ConfigurationFactoryBean, =
since
I don't use Spring MVC.
Are there plans to implement templates loading via the normal spring
Resource system
As well as something like a TransformerFactoryBean. I see something =
that
provides bean property configuration of the initial context, the =
template
location, and allows custom objects to be added to the context once the =
bean
has been obtained from the context.
This will make writing an email template system quite easy :
<bean id=3D"feedbackTransformer"
class=3D"spring.ui.freemarker.TransformerFactoryBean" =
singleton=3D"false">
<property
name=3D"templateLocation"><value>classpath:com/acme/feedback.ftl</value><=
/prop
erty>
<!-- all properties of the context are entered into a simple hash -->
<property name=3D"context">
<map>etc...</map>=09
</property>
</bean>
Then in your code you can do=20
TransformerFactoryBean transformer =3D
(TransformerFactoryBean)context.getBean("feedbackTransformer");
transformer.addParam("name", model.getName());
emailSender.send("fee...@ac...", "feedback", =
transformer.transform());
I can certainly write this implementation if it could be included in =
spring,
since I use something like it in my projects.
The only issue is that I don't understand the spring resource system.
I'll read about it you someone want me to implement this bean.
Thanks,
Cameron.
> -----Original Message-----
> From: spr...@li...=20
> [mailto:spr...@li...]
> On Behalf Of Darren Davison
> Sent: Tuesday, 9 March 2004 11:03 PM
> To: spr...@li...
> Subject: RE: [Springframework-developer] FreeMarker
>=20
>=20
> > Its me who is the doofus.. I didn't dig around enough to see the=20
> > superclass !
> >
> > Sorry about that.
>=20
> no worries. Let us know how the current code meets your=20
> existing needs; particularly whether your shared variables=20
> get exposed correctly to the FreeMarker template. We can=20
> then decide whether to add the stuff to the main source tree=20
> for 1.0-final (the FM guys are planning to release
> 2.3-RC1 any day now) or leave it in the sandbox until 1.1
>=20
> Cheers!
>=20
> --
> Darren Davison
> Public Key: http://www.davison.uk.net/key.jsp
>=20
>=20
>=20
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> administration.http://ads.osdn.com/?ad_id=1470&alloc_id638&op=3Dick
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>=20
|