Re: Sitemesh with Velocity Decorators and Spring MVC

Scott Farquhar <[email protected]> Tue, 30 Aug 2005 08:49:08 +1000
Newsgroups gmane.comp.web.sitemesh.general,gmane.comp.lang.pnuts.user
Message-ID <[email protected]>
Patrick,

On Mon, Aug 29, 2005 at 11:07:08AM -0500, Patrick Burleson wrote:
> I've been trying to figure out how to use Velocity as my decorator while also using Spring MVC also using Velocity to turn out the pages. 
> 
> With the base Velocity Decorator Servlet setup described by Sitemesh, it's true that my pages will get decorated by the templates defined. The crummy part is, those templates don't seem to have access to any of the dynamic content from the request or the session. Not to mention, they aren't able to use the Spring Velocimacros. 
> 
> I also know the problem here is that Sitemesh actually requests the page using the dispatcher, so it's actually a seperate request for the decorated pages. But surely, someone out there has figured this all out? This seems to come close:
>  http://www.jroller.com/page/timosinko/20050124

You should be able to do this completely without the second dispatch, and
is what Mike did here:

  http://jira.opensymphony.com/browse/SIM-112?decorator=printable

So it is possible - but it means that you need to hack it up yourself a
little bit.  This is because it needs to be done at the same time as your
particular MVC's redirect to the view technology.

Ideally, all MVC frameworks will integrate with sitemesh, which will mean
that they handle calling sitemesh directly, rather than sitemesh doing it
via the sitemesh filter.

Cheers,
Scott 

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]