From: Rimon B. <ba...@cs...> - 2002-12-01 19:38:10
|
Sure... return or raise spyceDone See: http://spyce.sourceforge.net/doc-runtime_except.html. Design rationale: The reason that this method continues to process the page (unlike the other redirects) is because it is often the case that people would like to display a page when this kind of redirect is used. The SourceForge download page, for example, uses this trick. They show you all the mirrors, and then redirect to the download file on the appropriate mirror after a few seconds. Other sites use the same technique to display a 'thank you' page, or the like. Incidentally, why are you using an redirect.externalRefresh(), and not a redirect.external(), or a redirect.internal()? The redirect.external() will change the url, just like the externalRefresh(). All the best, Rimon. On Sun, 1 Dec 2002, David Casti wrote: >Hi, > >I'm trying to do something like this -- > >[[ >sessionid = cookie.get( 'session' ) >session_dict = session.get( sessionid ) >if session_dict: { > username = session_dict[ 'username' ] >} else: { > redirect.externalRefresh( 'index.spy' ) >} > >]] > >-- the problem is that later in my page, I make reference to username. If >the session dictionary isn't present, there is no username, so I get an >exception. > >Is it possible to "bail out" of a spyce page by redirecting without >processing the rest of it? > >Thanks, >David. |