Hello, Is there a way in Zope to forward a request from one page to another. When I say "forward" a request, I want to retain all the GET and POST request parameters. So similar to <dtml-call expr="RESPONSE.redirect('...')"> but response.redirect loses all the request parameters. I've been looking around and couldn't find it. Any ideas? Thanks in advance! --------------------------------- Yahoo! Groups gets better. Check out the new email design. Plus theres much more to come.
if you want to go straight from one dtml routine to another just use dtml-var (ie. have dtml method A call dtml method B) - then in dtml method A have: <dtml-var methodB> This will 'pass' control and the REQUEST space from A to B. Is this is not what you are looking for, then provide some more info as to your use case. Jonathan ----- Original Message ----- From: Alric Aneron To: zope@zope.org Sent: Thursday, June 08, 2006 4:22 PM Subject: [Zope] dtml forwarding request Hello, Is there a way in Zope to forward a request from one page to another. When I say "forward" a request, I want to retain all the GET and POST request parameters. So similar to <dtml-call expr="RESPONSE.redirect('...')"> but response.redirect loses all the request parameters. I've been looking around and couldn't find it. Any ideas? Thanks in advance! ------------------------------------------------------------------------------ Yahoo! Groups gets better. Check out the new email design. Plus there's much more to come. ------------------------------------------------------------------------------ _______________________________________________ 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 )
The dtml_method where I want to forward to is on another server, so your may would be a little hard to do. Sorry, I didn't make myself clear the first time. Thanks, any suggestions? Jonathan <dev101@magma.ca> wrote: if you want to go straight from one dtml routine to another just use dtml-var (ie. have dtml method A call dtml method B) - then in dtml method A have: <dtml-var methodB> This will 'pass' control and the REQUEST space from A to B. Is this is not what you are looking for, then provide some more info as to your use case. Jonathan ----- Original Message ----- From: Alric Aneron To: zope@zope.org Sent: Thursday, June 08, 2006 4:22 PM Subject: [Zope] dtml forwarding request Hello, Is there a way in Zope to forward a request from one page to another. When I say "forward" a request, I want to retain all the GET and POST request parameters. So similar to <dtml-call expr="RESPONSE.redirect('...')"> but response.redirect loses all the request parameters. I've been looking around and couldn't find it. Any ideas? Thanks in advance! --------------------------------- Yahoo! Groups gets better. Check out the new email design. Plus there�s much more to come. --------------------------------- _______________________________________________ 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 ) --------------------------------- Sneak preview the all-new Yahoo.com. It's not radically different. Just radically better.
You can do a redirect and construct the cgi space from REQUEST. On Thu, 8 Jun 2006, Alric Aneron wrote:
The dtml_method where I want to forward to is on another server, so your may would be a little hard to do. Sorry, I didn't make myself clear the first time.
Thanks, any suggestions?
Jonathan <dev101@magma.ca> wrote: if you want to go straight from one dtml routine to another just use dtml-var (ie. have dtml method A call dtml method B) - then in dtml method A have:
<dtml-var methodB>
This will 'pass' control and the REQUEST space from A to B.
Is this is not what you are looking for, then provide some more info as to your use case.
Jonathan ----- Original Message ----- From: Alric Aneron To: zope@zope.org Sent: Thursday, June 08, 2006 4:22 PM Subject: [Zope] dtml forwarding request
Hello, Is there a way in Zope to forward a request from one page to another. When I say "forward" a request, I want to retain all the GET and POST request parameters. So similar to <dtml-call expr="RESPONSE.redirect('...')"> but response.redirect loses all the request parameters. I've been looking around and couldn't find it. Any ideas?
Thanks in advance!
--------------------------------- Yahoo! Groups gets better. Check out the new email design. Plus there�s much more to come.
---------------------------------
_______________________________________________ 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 )
--------------------------------- Sneak preview the all-new Yahoo.com. It's not radically different. Just radically better.
--
If you are using a zeo server and both server are zeo clients you could store the info on the zeo server, then do a redirect from serverA/methodA to serverB/methodB. If the servers do not have access to the same zeo server, then you are going to have to 'package-up' all the variables you need and send them to serverB/methodB Depending on what is happening in serverB/methodB you could just do some kind of rpc from serverA/methodA to serverB/methodB (ie. methodA just sends a request to methodB, which does some processing and sends the results back to methodA for final processing/display). It's kind of hard to guess what would be best without knowing more about the application(s). Jonathan ----- Original Message ----- From: Alric Aneron To: Jonathan ; zope@zope.org Sent: Thursday, June 08, 2006 4:31 PM Subject: Re: [Zope] dtml forwarding request The dtml_method where I want to forward to is on another server, so your may would be a little hard to do. Sorry, I didn't make myself clear the first time. Thanks, any suggestions? Jonathan <dev101@magma.ca> wrote: if you want to go straight from one dtml routine to another just use dtml-var (ie. have dtml method A call dtml method B) - then in dtml method A have: <dtml-var methodB> This will 'pass' control and the REQUEST space from A to B. Is this is not what you are looking for, then provide some more info as to your use case. Jonathan ----- Original Message ----- From: Alric Aneron To: zope@zope.org Sent: Thursday, June 08, 2006 4:22 PM Subject: [Zope] dtml forwarding request Hello, Is there a way in Zope to forward a request from one page to another. When I say "forward" a request, I want to retain all the GET and POST request parameters. So similar to <dtml-call expr="RESPONSE.redirect('...')"> but response.redirect loses all the request parameters. I've been looking around and couldn't find it. Any ideas? Thanks in advance! -------------------------------------------------------------------------- Yahoo! Groups gets better. Check out the new email design. Plus there�s much more to come. -------------------------------------------------------------------------- _______________________________________________ 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 ) ------------------------------------------------------------------------------ Sneak preview the all-new Yahoo.com. It's not radically different. Just radically better.
So there is no way to do it through python and DTML? I know Java has something like that. Jonathan <dev101@magma.ca> wrote: If you are using a zeo server and both server are zeo clients you could store the info on the zeo server, then do a redirect from serverA/methodA to serverB/methodB. If the servers do not have access to the same zeo server, then you are going to have to 'package-up' all the variables you need and send them to serverB/methodB Depending on what is happening in serverB/methodB you could just do some kind of rpc from serverA/methodA to serverB/methodB (ie. methodA just sends a request to methodB, which does some processing and sends the results back to methodA for final processing/display). It's kind of hard to guess what would be best without knowing more about the application(s). Jonathan ----- Original Message ----- From: Alric Aneron To: Jonathan ; zope@zope.org Sent: Thursday, June 08, 2006 4:31 PM Subject: Re: [Zope] dtml forwarding request The dtml_method where I want to forward to is on another server, so your may would be a little hard to do. Sorry, I didn't make myself clear the first time. Thanks, any suggestions? Jonathan <dev101@magma.ca> wrote: if you want to go straight from one dtml routine to another just use dtml-var (ie. have dtml method A call dtml method B) - then in dtml method A have: <dtml-var methodB> This will 'pass' control and the REQUEST space from A to B. Is this is not what you are looking for, then provide some more info as to your use case. Jonathan ----- Original Message ----- From: Alric Aneron To: zope@zope.org Sent: Thursday, June 08, 2006 4:22 PM Subject: [Zope] dtml forwarding request Hello, Is there a way in Zope to forward a request from one page to another. When I say "forward" a request, I want to retain all the GET and POST request parameters. So similar to <dtml-call expr="RESPONSE.redirect('...')"> but response.redirect loses all the request parameters. I've been looking around and couldn't find it. Any ideas? Thanks in advance! --------------------------------- Yahoo! Groups gets better. Check out the new email design. Plus there�s much more to come. --------------------------------- _______________________________________________ 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 ) --------------------------------- Sneak preview the all-new Yahoo.com. It's not radically different. Just radically better. --------------------------------- Sneak preview the all-new Yahoo.com. It's not radically different. Just radically better.
Alric Aneron wrote:
So there is no way to do it through python and DTML?
I know Java has something like that.
*lol* Well you should be sure you know what you do anyways. Forwarding requests means you trust the users browser to do the right thing. Maybe you can instead make a subrequest by means of urllib and friends. Construct url (e.g. GET-parameters) is easy: in a python script: from ZTUtils import make_query targeturl="http://other.server/script?"+make_query(**context.REQUEST.form) (untested) should work. To construct form elements there is a similar function in ZTUtils, but I dont remember the name w/o looking at the source. Regards Tino Wildenhain
On Thu, Jun 08, 2006 at 11:39:19PM +0200, Tino Wildenhain wrote:
Alric Aneron wrote:
So there is no way to do it through python and DTML?
I know Java has something like that.
ZEO is the canonical way to distribute zope stuff.
Well you should be sure you know what you do anyways. Forwarding requests means you trust the users browser to do the right thing. Maybe you can instead make a subrequest by means of urllib and friends.
If you do that, you're getting into the world of RPC and service-oriented development. There are a zillion ways to do that in zope... urllib/urllib2 as suggested, or you can use the callRemote() features of a sufficiently recent ZSyncer (see the README), or use zope's built-in XMLRPC server and on the client side use python's xmlrpclib. The latter two options are nice because they give you native python objects on both ends of the wire. Pretty much all of these will require you to write some "trusted" code, i.e. on the filesystem (in a Product or External Method). -- Paul Winkler http://www.slinkp.com
participants (5)
-
Alric Aneron -
Dennis Allison -
Jonathan -
Paul Winkler -
Tino Wildenhain