forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ross Gardler" <rgard...@apache.org>
Subject Re: Conditional application of dispatcher contracts
Date Wed, 13 Jun 2007 21:59:19 GMT
On 13/06/07, Thorsten Scherler <thorsten@apache.org> wrote:
> On Tue, 2007-06-12 at 23:00 +0100, Ross Gardler wrote:
> > How can I change the behavior of a dispatcher contract depending on
> > the page being requested?
> >
> > Specifically, how can I make a template be used for a request of
> > "projectDetails/foo.html" and "projectDetails/foo/bar.html", but not
> > for "projectDetails/index/byCategory.html"?
>
> 1) implementing in
> ${project.resources-dir}/structurer/url
> mkdir -p projectDetails/foo
> mkdir -p projectDetails/index
> vi projectDetails/foo/${dispatcher.theme}.fv
> vi projectDetails/index/${dispatcher.theme}.fv
>
> Important is that the template name is equal to ${dispatcher.theme}!

This doesn't work, there must be a bug. I've created a test case in
the dispatcher docs and will file a bug report in a moment.

> 2) implementing presentation logic in the main ${dispatcher.theme}.fv
> like:
> <jx:if test="${!
> getRequest.contains('projectDetails/index/byCategory')}">
>  <forrest:contract name="myContract"/>
> </jx:if>

Ahhh - of course. So obvious when it's pointed out.

Thanks,
Ross

Mime
View raw message