• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Redirecting internally
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Redirecting internally


  • Subject: Re: Redirecting internally
  • From: Zak Burke <email@hidden>
  • Date: Thu, 21 Jul 2005 22:02:34 -0400

Eric Stewart wrote on 7/21/05 5:19 PM:
> I'm currently converting a script originally in cgi to WO. The server
> gets requests something similar to this
> http://www.example.com/cgi-bin/script.cgi?a=1&b=2.
>
> I need that to be internally redirected to
> http://www.example.com/cgi-bin/WebObjects/Script.woa/wa/action?a=1&b=2

bounce the browser from the CGI to the WO page:

#!/usr/local/bin/perl
print "Location: http://...wa/action?$ENV{'QUERY_STRING'}\n\n";


or grab content from the new page, but display it as though
http://www.example.com/cgi-bin/script.cgi?a=1&b=2 itself generated the
content:

#!/usr/local/bin/perl

use strict;
use LWP;

main();

sub main
{

    print "Content-type: text/html\n\n";

    my $ua = LWP::UserAgent->new();
    my $url = "http://.../Script.woa/wa/action?$ENV{'QUERY_STRING'}";
    my $res = $ua->get($url);
    if ( $res->is_success ) {

        print $res->content;

    } else {

        print "ERROR retrieving $url: " . $res->status_line();

    }
}







 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Redirecting internally
      • From: Galen Rhodes <email@hidden>
References: 
 >Redirecting internally (From: Eric Stewart <email@hidden>)

  • Prev by Date: form looses text field data when the window is opened again
  • Next by Date: Re: Redirecting internally
  • Previous by thread: Re: Redirecting internally
  • Next by thread: Re: Redirecting internally
  • Index(es):
    • Date
    • Thread