Re: Configuration capabilities
kukudas <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
Hello,
thanks for your reply well the goal i want is somehow define a place wher ei
can store templates as moduls.
and let it wire up on the view by my framework struts 2 or alternatevly
spring.
i found something like this:
<bean id="freemarkerConfig"
class="org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean">
<property
name="templateLoaderPath"><value>/WEB-INF/freemarker/</value></property>
</bean>
i will try this it looks promesing im guessing that i can access every
template in that folder
on my view like this -> <#import "content.ftl" as con> for example?
is there a way to do something similar by struts 2? or which way would be
the best practise
using spring or struts 2?
i guess i have to read the programmers guide i mostly read only the
other part and just looked over the programmer part.
Anyway Thank you for you help.
Daniel Dekany wrote:
>
> Thursday, June 12, 2008, 3:03:27 PM, kukudas wrote:
>
>> Hello everybody,
>>
>> i did now successfully set up a little test project with struts 2 and
>> freemarker it's still "low" but it's working :). I have one question i'm
>> using in my action something like this:
>>
>> Configuration c = new Configuration();
>> c.setDirectoryForTemplateLoading(new File("C:/MyModules/All/"));
>> c.getTemplate("module.ftl");
>>
>> which kinda works i don't get any exception or so. But i dont know how to
>> use this now
>> on my view. Like somehow a reference <#include c> or so i kinda don't
>> find
>> any examples just some
>> code snipplets which i put together and try out but well ...
>
> Huh?
>
>> Is there maybe any source for newbies i'm mean you guys had to learn this
>> someway :).
>
> I think http://freemarker.org/docs/pgui_quickstart.html tells how to
> use FreeMarker on the programmer's side quite clearly. Also there are
> some examples packed with the "examples" directory of the FreeMarker
> distro, including a Struts 1.x example.
>
>> In the Documentation i've read so far it's kinda thin i gues sits
>> writting for users they have more expierince then me. What i'm
>> missing is like what i can do after i load a certain template.
>
> After you get a template, you have a Template object, that you can
> "process", i.e., merge with a data-model, for as many times as you
> want. But I guess that was clear. If not, then you missed the Getting
> Started stuff linked above.
>
> Well, something that the Getting Started doesn't mention that you can
> create the freemarker.core.Environment manually, as shown in
> http://freemarker.org/docs/app_faq.html#faq_question_19, which lets
> you adjust or read the runtime environment of the template both before
> and after the template is processed.
>
>> Like manipulate it
>
> No... Template objects are immutable. OK, not quite, but basically
> yes.
>
>> (which i proably don't want to do but still to know how would be
>> nice) or to set it up on diffrend views.
>
> I don't know what you mean by this.
>
>> maybe i'm just not searching hard enough for sources but i feel like i
>> do. I
>> hope anyone could help me with examples/sources and i hope i don't annoye
>> you guys with my newbie questions.
>
> But what *exactly* is your question?
>
>> greets kukudas
>
> --
> Best regards,
> Daniel Dekany
>
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> FreeMarker-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/freemarker-user
>
>
--
View this message in context: http://www.nabble.com/Configuration-capabilities-tp17799498p17809270.html
Sent from the freemarker-user mailing list archive at Nabble.com.
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php