Re: Configuration capabilities
Daniel Dekany <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
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