velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frank Temi <frank_t...@yahoo.com>
Subject Re: include / parse
Date Fri, 06 Jun 2003 17:03:55 GMT
That sounds like a good plan.  Thanks for the quick
response.

Frank


--- SETH.LIPSCHITZ@chase.com wrote:
> 
> When I come into issues like this, what I do is come
> up with java objects
> that have these methods and put them in the context.
>  For example:
> 
> import java.io.*;
> class FileChecker
> {
>        public boolean fileExists (String fileName)
>        {
>               if (new File (fileName).exists())
> return true;
>               else return false;
>        }
> }
> 
> And always put this into the context if you need it.
> FileChecker checker = new FileChecker();
> ctx.put ("doesExist",checker)
> 
> in the vm:
> #if ($doesExist.fileExists("file.html")
>      #include ("file.html")
> #end
> 
> Thanks,
> Seth
> 
> 
>                                                     
>                                                     
>          
>                     Frank Temi                      
>                                                     
>          
>                     <frank_temi@ya       To:    
> velocity-user@jakarta.apache.org                    
>              
>                     hoo.com>             cc:        
>                                                     
>          
>                                          Subject:   
>  include / parse                                    
>          
>                     06/06/03 12:44                  
>                                                     
>          
>                     PM                              
>                                                     
>          
>                     Please respond                  
>                                                     
>          
>                     to "Velocity                    
>                                                     
>          
>                     Users List"                     
>                                                     
>          
>                                                     
>                                                     
>          
>                                                     
>                                                     
>          
> 
> 
> 
> 
> Hi there, I have a question regarding the #include,
> #parse functions.  Basically I am wondering if it is
> possible to make sure the file exists first before
> calling these statements.
> 
> So for example something like:
> 
> 1  #if (file exits)
> 2     #include("/file.html")
> 3  #end
> 
> Thanks for any help,
> 
> 
> Frank
> 
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo.
> http://search.yahoo.com
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> velocity-user-help@jakarta.apache.org
> 
> 
> 
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> velocity-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.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