velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Bubna" <nbu...@gmail.com>
Subject Re: Templates in VelocityLayoutServlet
Date Fri, 04 Jan 2008 22:45:48 GMT
I don't understand what you are trying to accomplish here.  What
layout template are you using?  Which template below is your layout
and which is your $screen_content?

It seems like you are using the layout servlet very strangely, trying
to do your own layout system in addition to the built in one.  It's a
bit confusing, so i'm not sure how to help you.

On Jan 3, 2008 9:27 PM, Michael Yartsev <anijap@gmail.com> wrote:
> I'll try to keep this short.
>
> I am creating a website using VLS and part of my template is
> /******************************************************
>             <div id="content">
>                 #parse($mainContent)
>             </div>
> ******************************************************/
>
> A small test function I created that is part of the "board" tool
> /******************************************************
> int c = 0;
>
> public int nexxt() {
>     c++;
>     return c;
>  }
> ******************************************************/
>
> Here comes the interesting part, at first my pages were like this (test.vm)
> /******************************************************
> #set($pageTitle = "test page")
> #set($mainContent = "test.vm")
>
> $board.nexxt()
> ******************************************************/
>
> But whenever I load the page, the counter increases by 2. So it is loading
> the page twice.
>
> Then, I made two files "test.vm"
> /******************************************************
> #set($pageTitle = "test page")
> #set($mainContent = "test_content.vm")
> ******************************************************/
> and "test_content.vm"
> /******************************************************
> $board.nexxt()
> ******************************************************/
>
> Now everything works as expected and the counter goes up by 1.
> But, how can I avoid having two pages like this?
>
>
> On an interesting sidenote if I change the template to
> /******************************************************
>             <div id="content">
>                 $mainContent
>             </div>
> ******************************************************/
>
> and test.vm to
> /******************************************************
> #set($pageTitle = "test page")
> #set($mainContent = " #parse('test.vm') ")
>
> $board.nexxt()
> ******************************************************/
>
> The counter starts going up by 10!!!
>
> Thanks in advance,
>
> -Mike
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


Mime
View raw message