velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shinobu Kawai <shinobu.ka...@gmail.com>
Subject Re: file not found in #include #parse
Date Mon, 08 Nov 2004 06:48:25 GMT

Hi Manish,

> How can I handle the condition gracefully that file specified by$fileName
> does not exist in either -
> 
> #include($fileName)
> #parse($fileName)
If you know the $fileName prior to the template handling, you can use
the templateExists() method and check.  I believe in 1.4 they are called
resourceExists().
    http://jakarta.apache.org/velocity/api/org/apache/velocity/app/VelocityEngine.html#templateExists(java.lang.String)
    http://jakarta.apache.org/velocity/api/org/apache/velocity/app/Velocity.html#templateExists(java.lang.String)

Best regards,
-- Shinobu Kawai

--
Shinobu Kawai <shinobu.kawai@gmail.com>


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


Mime
View raw message