Re: How to stop (w/o exception)
"Jonathan Revusky" <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
It seems to me that [#stop] is what you want. It's true that this works by throwing an exception, but this is technically the way it has to work to abort FTL processing at an arbitrary point in the page, since this involves jumping out of control structures that are arbitrarily deeply nested on the java side. I don't think there's any other way to jump out... Basically, if you explicitly catch freemarker.core.StopException and do nothing to handle it, then #stop will basically stop gracefully, or at least as gracefully as is technically possible AFAICS. JR On Tue, Feb 26, 2008 at 5:44 PM, Newman, John W <[email protected]> wrote: > > > > > Hi, > > > > I tried searching but sourceforge is down… I'm sure this has been discussed > before. > > > > > > We have the [#stop /] directive which throws an exception. Is there a way > to stop processing gracefully? > > > > > > [#if somethingBad] > > [#stopGracefully /] > > [/#if] > > > > Sure I could do > > > > [#if ! somethingBad] > > Everything here > > [/#if] > > > > But I'm pretty sure there is a break or stop thing that should work here. > Just wondering, thanks. > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > FreeMarker-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/freemarker-user > > ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/