forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorsten Scherler <thors...@apache.org>
Subject Re: Conditional application of dispatcher contracts
Date Wed, 13 Jun 2007 10:48:46 GMT
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}!

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>

> 
> Note that overriding the theme with "projectDetails/theme.fv" and
> "projectDetails/index/theme.fv" does not work as I would have
> expected, the second theme requested is never used. 
> This looks like a
> cache problem, is it?

Hmm, not sure would be new. Should work fine: is the template name equal
to ${dispatcher.theme}?

salu2
-- 
Thorsten Scherler                                 thorsten.at.apache.org
Open Source Java                      consulting, training and solutions


Mime
View raw message