velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dhaval.h.ud...@orbitech.co.in
Subject RE: #parse() directive
Date Wed, 16 Apr 2003 14:06:02 GMT
As I mentioned earlier, how about using a StringResourceLoader. I have
created one and it seems to be working fine. I was wondering whether
something of this kind would be useful in standard Velocity.

This requirement would be present to a large extent in cases where hte
templates are being generated dynamically.


-----Original Message-----
From: nathan [mailto:nathan@esha.com]
Sent: Wednesday, April 16, 2003 7:30 PM
To: velocity-user
Cc: nathan
Subject: Re: #parse() directive


dhaval.h.udani said:
> I have some doubts about the #parse() directive. I believe that apart
> from a filename even a Velocity variable can be given here. However it
> seems that the variable must refer to a template file which can be
found
> via the ResourceManager mechanism. However in my case, the variable
> actally refers to a string containing VTL. I need this VTL to be
parsed
> sign the context I supplied. i.e. instead of using the ResourceManager
> to lcoate a template file, I am giving the contents of the template
> which need to be parsed.

you are mistaking the purpose of the #parse directive.  what you need is
a
tool such as Simon suggests.  try:

http://cvs.apache.org/viewcvs/jakarta-velocity-tools/src/java/org/apache
/vel
ocity/tools/generic/RenderTool.java?rev=1.1&content-type=text/vnd.viewcv
s-ma
rkup

or if you are using Velocity-Tools, use

http://cvs.apache.org/viewcvs/jakarta-velocity-tools/src/java/org/apache
/vel
ocity/tools/view/tools/ViewRenderTool.java?rev=1.1&content-type=text/vnd
.vie
wcvs-markup

for greater convenience.

Nathan Bubna
nathan@esha.com


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


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