Re: Is there a directive like <#continue> and <#exit>?
Attila Szegedi <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
On 2009.02.12., at 8:14, Jiming Liu wrote: > Hi, > > Sometimes, I need break the parse of file by using <#exit> like > directive. Freemarker has <#stop>, but the document says <#stop> is > to process exception. Is there any other way I can exit a parsing > process? Parsing, or rendering? Well, you can put the full body of your template in a macro, and then use <#return/> in it. Of course, that doesn't exit from multiple levels of macros, includes, etc. For that functionality, <#stop/> is the way to go - you just need to make sure to catch and ignore the exception on the top-level (again, you might be able to use FreeMarker's <#attempt> ... <#recover> on top level for that). > And I also find that add a directive <#continue> would be very > helpful. What would it do? Continue with next iteration of a loop? Attila. > Great thanks > > Jiming ------------------------------------------------------------------------------ Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com