Re: View Loading and Caching

Anthony Eden <[email protected]> Thu, 27 Feb 2003 09:22:38 -0500
Newsgroups gmane.comp.java.jpublish.devel
Message-ID <[email protected]>
I have committed your patch, but I want to say that it still bothers me.  The problem is that you will need to provide a new implementation of the FreeMarkerViewContext because that class only provides a wrapped version of the JPublishContext.  In most cases you will probably want to just put values directly in the JPublish context via an action.  That is unless I am missing a compelling reason why you must populate the FreeMarker context directly?

Sincerely,
Anthony Eden

Andy Zeneski wrote:
>>What is the point of passing the path to the createTemplateContext()
>>method?  Also, can you explain to me why you would want to override this
>>method?  I.e. why would you want to create a different instance of the
>>root context when it is just a wrapper around the JPublishContext?
>>
> 
> 
> I put the path there, just in case someone came up with a reason to use it
> and because it was available.
> 
> The main reason for overriding this method is because other objects in
> addition to the JPublishContext may (and in our case do) need to be in the
> root context for the template. We have some custom transforms and freemarker
> methods which need to be in the root. Also, we utilize some of the wrappers
> for request parameters, etc.
> 
> I thought this would make it more flexible for customization and allow to
> reuse as much existing code as possible.
> 
> -Andy
> 



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf