On 10/11/05, Kai Andresen <[EMAIL PROTECTED]> wrote:
> Hello,

Hi Kai!

> >
> I copied the My/App test application from the CGI-Prototype
> distribution,

There's a fully functioning CGI::Prototype app here:

    http://www.metaperl.org/Guestbook

You can download the tarfile and look through it. I can explain
it to you step-by-step if you have questions.

> and added a app.cgi like: use strict; use warnings; use lib qw(
> /real/path/here );
>
> use My::App;
> My::App->activate;
>
> ----
> Now, directing the browser to the application brings up the welcome
> page, and the source of the page seems ok, form, action, fields and
> submit-button and all.

Cool...

> >
> But filling out the form and submitting it, only yields the same page.

What did the FORM action attribute action have?

> > The only way to get to the thanks-page is to add the parameters into
> the url, like http:://localhost/app.cgi?first=john&last=doe   -> then
> I get the nice thank-you-page.

Cool...

> >
> I use this under a recent Cygwin installation, Perl 5.8.7, and lighthttpd
>
> I obviously miss something fundamental here, but I can't figure it
> out, can anyone point me in the right direction?

Yes, I think what you are missing is the concept of dispatch. If you look
at the activate method in package CGI::Prototype (the easiest way to learn
CGIP is to look at the source code), it calls dispatch early on in the
activate method. The default dispatch method looks like this:

 sub dispatch {
  my $self = shift;
  return $self;         # do nothing, stay here
 }

And so the same page object returning itself is no surprise. In fact,
unless you subclass the default dispatch method and specializing it
to do certain things with a certain query string parameter (such as
rm for runmode), you should never get a different page.

If you dont want to handle dispatch yourself, you can use Aristotle's
CGI::Prototype::PathInfo, which you can get here:

  http://prdownloads.sourceforge.net/cgi-prototype/PathInfo.pm?download

The dispatch logic is documented in the code.

I've also uploaded it to our Sourceforge CVS project  but there is a
5-hour delay between anonymous and developer access to cvs updates.


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users

Reply via email to