Subject: | url path not included in generated code |
Apache2::Ajax version 0.11
Ajax.pm line 99 reads:
my $url = $cgi->url;
Perhaps it should read:
my $url = $cgi->url(-path => 1);
<Location /app1/test>
SetHandler perl-script
PerlResponseHandler App1::Test
</Location>
The above apache config would allow us to call, for instance:
http://localhost/app1/test?action=show
Assuming we had defined an Ajax method named "AJAX_get_detail", the
pertinent section of generated javascript would look like this:
var l = ajax.length; ajax[l]= new pjx(args,"AJAX_get_detail",args[2]);
ajax[l].url = 'http://localhost/app1?' + ajax[l].url; ajax[l
].send2perl();
When called, this generates the following apache error:
File does not exist: /myapp/htdocs/app1, referer:
http://localhost/app1/test
This error is slightly misleading, implying it's a file system issue.
The problem is that http://localhost/app1 doesn't match the Location
"/app1/test".
Changing the call to CGI::url() as above fixes the problem.
Thanks.