velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Tesser <jasontes...@gmail.com>
Subject Re: From Viewtool get the VTL being parsed
Date Sat, 08 Aug 2009 15:58:33 GMT
I ended up doing this which works

ica = new InternalContextAdapterImpl(ctx);
String fieldResourceName = ica.getCurrentTemplateName();

Thanks,
Jason Tesser
dotCMS Lead Development Manager
1-305-858-1422


On Sat, Aug 8, 2009 at 11:27 AM, Nathan Bubna <nbubna@gmail.com> wrote:

> a tool can really only get access to whatever is in the context or
> what is manually given to it.  since the HttpServletRequest is
> available automatically, they can get the request path and derive the
> file from that.   just know that even that isn't perfect; if the
> request path points to foo.vm and foo.vm does #parse('bar.vm') which
> is the one with your tool being used in it, there's no way for the
> tool to know that without being told, since #parse doesn't really
> inject info about itself into the context.
>
> On Sat, Aug 8, 2009 at 6:01 AM, Jason Tesser<jasontesser@gmail.com> wrote:
> > From a viewtool I need to get the name of the file being parsed. Is that
> > possible?
> >
> > Thanks,
> > Jason Tesser
> > dotCMS Lead Development Manager
> > 1-305-858-1422
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message