Re: [Zope] RESPONSE.redirect not working
Am 24.05.2006, 00:24 Uhr schriebte Andrew Hedges [EMAIL PROTECTED]: I'm at my wit's end. Any help is appreciated. Yes, I have worn Google out trying to figure this out. In my (yeah, yeah, I know) DTML method, I have structured things like so: dtml-call pyCheckSession -- a Python script that checks Hi there! Given your code in pyCheckSession try the following (not tested): dtml-unless pyCheckSession dtml-return /dtml-unless and change pyCheckSession to: if url '': If we have need to, bump the user out RESPONSE.redirect(url) return 0 else: return 1 The call to redirect doesn't magically stop processing of everything else you programmed. Hope it helps, Jo. -- internetmanufaktur jo- Berlin, Germany |||meder--- fon: ++49-30-44 04 27 82 http://www.meder.de/ fax: ++49-30-44 04 30 95 Kollwitzstr. 66 mob: ++49-170- 2 98 89 97 10435 Berlin ---http://www.meder.de/keys/jo-pubkey.txt ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] RESPONSE.redirect not working
Jo, THANK YOU! This worked (with a slight change to the dtml-return): dtml-unless pyCheckSession dtml-return login_html /dtml-unless I *thought* I had seen redirect work as I had had it before, but maybe I misunderstood what was happening. In any case, many thanks! -Andrew On May 23, 2006, at 5/23/2006 4:46 PMMDT, Jo Meder wrote: Hi there! Given your code in pyCheckSession try the following (not tested): dtml-unless pyCheckSession dtml-return /dtml-unless and change pyCheckSession to: if url '': If we have need to, bump the user out RESPONSE.redirect(url) return 0 else: return 1 The call to redirect doesn't magically stop processing of everything else you programmed. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] RESPONSE.redirect not working
Actually, that is exactly what is happening. It's the current URL with the contents of login_html rendered. I changed it to the following and it worked: dtml-unless pyCheckSession dtml-return expr=1 /dtml-unless Thanks again for your help! -Andrew On May 23, 2006, at 5/23/2006 5:02 PMMDT, Jo Meder wrote: Am 24.05.2006, 00:57 Uhr schriebte Andrew Hedges [EMAIL PROTECTED]: dtml-unless pyCheckSession dtml-return login_html /dtml-unless Are you sure you're seeing the redirect there and not just the login page rendered for the address you were originally accessing? Just wondering... Jo. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] response.redirect not working
Hello, I have a web page, a form on it, and on form submit action (to the same page) I do some database actions (update some record, to be correct). The exact code looks like this (filename edit_html): . (1) dtml-if form (2) dtml-call RESPONSE.redirect('index_html') p style=color:greenbSaved./b/p (3) dtml-in db_fulluseredit(zd=_['zd'], orig_login=_['uid'], login=_['login'], vardas=_['vardas'], pavarde=_['pavarde'], nickas=_['nickas'], email=_['email'], address=_['address'], phone=_['phone'], pastabos=_['pastabos'], date_gime=_['date_gime'], date_valid=_['date_valid'], planas=_['planas'], current_user_login=AUTHENTICATED_USER.getUserName()) . On #1 line I check if form variable is defined (it's defined in form, so if the form is opened for the first time, the form is naturally null, and if the form is submitted - it's defined to 1 [input type=hidden name=form value=1] ). #2 line let's skip for a moment. On #3 line I do database actions with result checking. (On a wider scope - the form is for user properties management - name, surname, address, login, phone, notes etc.). The problem is on line #2. According to what's written, zope should drop everything and do immediate redirect to page index_html (ok, it's not where the first error appeared, I just managed to generate this error as the most clearest and best visible one), but instead zope calmly executes database actions and does other stuff till the end of the document. Id be very thankful for any ideas... it's sad not to control own code :/ If you want, I can send you the whole code as well as to provide access to the live system. Zope version: 2.6.4-1.8. Debian, postgresql 7.4 (latest 7th, I don't remember exact version now). Artras [EMAIL PROTECTED] ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] response.redirect not working
On Fri, May 20, 2005 at 11:45:58PM +0300, Art??ras wrote: The problem is on line #2. According to what's written, zope should drop everything and do immediate redirect to page index_html (ok, it's not where the first error appeared, I just managed to generate this error as the most clearest and best visible one), but instead zope calmly executes database actions and does other stuff till the end of the document. I don't think RESPONSE.redirect() can reasonably be expected to stop all further processing of your script or template. It simply adds a header to the response, which has no effect until the client receives it. -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] response.redirect not working
Artras wrote: Hello, I have a web page, a form on it, and on form submit action (to the same page) I do some database actions (update some record, to be correct). The exact code looks like this (filename edit_html): . (1) dtml-if form (2) dtml-call RESPONSE.redirect('index_html') p style=color:greenbSaved./b/p (3) dtml-in db_fulluseredit(zd=_['zd'], orig_login=_['uid'], login=_['login'], vardas=_['vardas'], pavarde=_['pavarde'], nickas=_['nickas'], email=_['email'], address=_['address'], phone=_['phone'], pastabos=_['pastabos'], date_gime=_['date_gime'], date_valid=_['date_valid'], planas=_['planas'], current_user_login=AUTHENTICATED_USER.getUserName()) . On #1 line I check if form variable is defined (it's defined in form, so if the form is opened for the first time, the form is naturally null, and if the form is submitted - it's defined to 1 [input type=hidden name=form value=1] ). #2 line let's skip for a moment. On #3 line I do database actions with result checking. (On a wider scope - the form is for user properties management - name, surname, address, login, phone, notes etc.). The problem is on line #2. According to what's written, zope should drop everything and do immediate redirect to page index_html (ok, it's not where the first error appeared, I just managed to generate this error as the most clearest and best visible one), but instead zope calmly executes database actions and does other stuff till the end of the document. Id be very thankful for any ideas... it's sad not to control own code :/ If you want, I can send you the whole code as well as to provide access to the live system. Zope version: 2.6.4-1.8. Debian, postgresql 7.4 (latest 7th, I don't remember exact version now). Artras [EMAIL PROTECTED] ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) __ NOD32 1.1103 (20050520) Information __ This message was checked by NOD32 antivirus system. http://www.nod32.com Arturas, RESPONSE.redirect drops request (including form vars). Maybe thats a clue? David ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] response.redirect not working
Hello The dtml-return RESPONSE.redirect('index_html') did the trick :) Thank you, Jo :) For David: this redirect was for exceptional situation - if user ID was changed the the whole page had to be reloaded with new ID, that was redirect('user_html?id=') style. All other variables should have been dropped. This was the expected behavior :) Thank you all for your support and ideas :) Artras -Original Message- From: Jo Meder [mailto:[EMAIL PROTECTED] Sent: 2005 m. gegus 21 d. 00:10 To: Art??ras Subject: Re: [Zope] response.redirect not working Am 20.05.2005, 22:45 Uhr schrhb Art??ras [EMAIL PROTECTED]: (1) dtml-if form (2) dtml-call RESPONSE.redirect('index_html') dtml-call ... won't stop processing of the rest of the page. Have you tried dtml-return RESPONSE.redirect('index_html') instead? Jo. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] RESPONSE.redirect
It's a html meta-tag that does the trick, not http. Look at http://www.geocities.com/siliconvalley/campus/1924/metacom.html. HTH Ragnar Hi all, I'd like to show a page and after a few seconds I'd like to redirect to another page. If I simply add !--#call "RESPONSE.redirect"-- it is done immediately. How can I achieve a delay of a couple of seconds? Oliver ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] RESPONSE.redirect
Hi all, I'd like to show a page and after a few seconds I'd like to redirect to another page. If I simply add !--#call "RESPONSE.redirect"-- it is done immediately. How can I achieve a delay of a couple of seconds? Oliver ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] RESPONSE.redirect
On Monday 29 January 2001 09:14, Oliver Vecernik wrote: Hi all, I'd like to show a page and after a few seconds I'd like to redirect to another page. If I simply add !--#call "RESPONSE.redirect"-- it is done immediately. How can I achieve a delay of a couple of seconds? Oliver meta refresh in your headers should do it. you can use dtml to dynamically insert the redirect page. standard html (4?) k ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] RESPONSE.redirect
From: [EMAIL PROTECTED] Oliver Vecernik I'd like to show a page and after a few seconds I'd like to redirect to another page. If I simply add !--#call "RESPONSE.redirect"-- it is done immediately. How can I achieve a delay of a couple of seconds? First you should send the page you want to show, then you should redirect to a page with a delay. Probably you should write it in an external Python method. That page should then redirect to the target page. Or you could drop the middle page and build the delay into the target page. That is stupid though if it is also accesed from elsewhere than the first page you want shown. Or you could make a delay in JavaScript and after that do a self.document.src = "new/url" Regards Max M Max M. W. Rasmussen,Denmark. New Media Director private: [EMAIL PROTECTED] work: [EMAIL PROTECTED] - Shipping software is an unnatural act ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] RESPONSE.redirect
Max M wrote: From: [EMAIL PROTECTED] Oliver Vecernik I'd like to show a page and after a few seconds I'd like to redirect to another page. If I simply add !--#call "RESPONSE.redirect"-- it is done immediately. How can I achieve a delay of a couple of seconds? First you should send the page you want to show, then you should redirect to That's what I did. a page with a delay. Probably you should write it in an external Python method. How can this be done? Can you give me an example? That page should then redirect to the target page. Or you could drop the middle page and build the delay into the target page. That is stupid though if it is also accesed from elsewhere than the first page you want shown. Or you could make a delay in JavaScript and after that do a self.document.src = "new/url" I've forgotten to mention: Browser can only display HTML 3.2 and *no* JavaScript. Thus it should be done on server side. Oliver ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Response.redirect problem **sometimes** on netscape
Hello, I'm doing a form for deleting objects within our site design (no manage interface). All goes well, with a FORM FORM ACTION="dtml-var URL1" METHOD="POST" . [ we create the ids:list here] INPUT TYPE="SUBMIT" NAME="myDelete:method" VALUE="Del" myDelete method does also the redirect on the calling page. dtml-if ids dtml-call "manage_delObjects(ids)" /dtml-if dtml-call "RESPONSE.redirect(URL1)" In IE5 works fine, but NO REDIRECT on Netscape 4.51 (blank page and the post data still there), while the RESPONSE.redirect **works** on other occasions with N4.51. Is it a known problem, or a problem calling manage_delObjects bfore redirection ? If not, seems like a bug somewhere in the headers ? Thanks in advance. -- Didier Georgieff DDAF du Bas-Rhin - Cellule SIG 2, rue des Mineurs 67070 Strasbourg Cedex tél : 03.88.25.20.33 - fax : 03.88.25.20.01 email : [EMAIL PROTECTED] SIT du Bas-Rhin : http://www.bas-rhin.sit.gouv.fr GéoWeb http://sertit10.u-strasbg.fr ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Response.redirect problem **sometimes** on netscape
Didier Georgieff writes: dtml-call "RESPONSE.redirect(URL1)" In IE5 works fine, but NO REDIRECT on Netscape 4.51 (blank page and the post data still there), while the RESPONSE.redirect **works** on other occasions with N4.51. I use Shane's "tcpwatch" (-- zope.org) to analyse such problems. Dieter ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] RESPONSE.redirect and frames
hello .. is there a possibilty to use RESPONSE.redirect using frames and targets? ... thnx ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )