You are viewing a plain text version of this content. The canonical link for it is here.
Posted to asp@perl.apache.org by "John D. Leonard II" <jo...@ce.gatech.edu> on 2002/03/08 12:55:26 UTC

Error Document

All:

I'm tryin to get the error document facility working for 401 error
(authorization failure.) My first try was to simply add the following
code in the Script_OnStart

sub Script_OnStart{
$Response->ErrorDocument('401',<<EOF);
<html>
<body>
<h1>Nee-ner nee-ner nee-ner</h1>
You can't get me!
</body>
</html>
EOF
}


However, when I hit a protected page and fail out, the standard message
is shown.

Am I missing some configuration setting somewhere (perhaps in the
httpd.conf?)

Thanks,

JL


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Re: Error Document

Posted by Ellers <el...@iinet.net.au>.
At 12:45 PM -0800 8/3/02, Joshua Chamas wrote:
>"John D. Leonard II" wrote:
>>
>  > I'm tryin to get the error document facility working for 401 error
>  > (authorization failure.)
>...
>  > However, when I hit a protected page and fail out, the standard message
>>  is shown.
>>
>...
>For your purposes, you might do what you want better by using
>Apache->custom_response API directly in a early mod_perl request
>stage, or the Apache ErrorDocument config.

In my work I used the following in the httpd.conf to handle missing 
document (404) requests. Presumable 401 would work identically?

	ErrorDocument 404 /404.asp

Then in 404.asp you can put whatever you want.

HTH
Ellers

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Re: Error Document

Posted by Joshua Chamas <jo...@chamas.com>.
"John D. Leonard II" wrote:
> 
> Josh:
> 
> > For your purposes, you might do what you want better by using
> > Apache->custom_response API directly in a early mod_perl request
> > stage, or the Apache ErrorDocument config.
> 
> Do you know if the Apache ErrorDocument code will process an ApacheASP
> document?  I'd like to use my existing ASP application to present the
> error messages.
> 

If ErrorDocument specifies a file name that would normally be 
executed as an ASP script, then yes, your script will work for it
just fine.

--Josh
_________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks Founder                       Huntington Beach, CA  USA 
http://www.nodeworks.com                1-714-625-4051

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


RE: Error Document

Posted by "John D. Leonard II" <jo...@ce.gatech.edu>.
Josh:

> For your purposes, you might do what you want better by using
> Apache->custom_response API directly in a early mod_perl request
> stage, or the Apache ErrorDocument config.

Do you know if the Apache ErrorDocument code will process an ApacheASP
document?  I'd like to use my existing ASP application to present the
error messages.

JL


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Re: Error Document

Posted by Joshua Chamas <jo...@chamas.com>.
"John D. Leonard II" wrote:
> 
> All:
> 
> I'm tryin to get the error document facility working for 401 error
> (authorization failure.) My first try was to simply add the following
> code in the Script_OnStart
> 
> sub Script_OnStart{
> $Response->ErrorDocument('401',<<EOF);
> <html>
> <body>
> <h1>Nee-ner nee-ner nee-ner</h1>
> You can't get me!
> </body>
> </html>
> EOF
> }
> 
> However, when I hit a protected page and fail out, the standard message
> is shown.
> 

I am not sure that this will work because the 401 auth layer will
be executed prior to Script_OnStart, or the Apache::ASP handler even,
so your code never gets a chance to run.

For your purposes, you might do what you want better by using
Apache->custom_response API directly in a early mod_perl request
stage, or the Apache ErrorDocument config.

--Josh

_________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks Founder                       Huntington Beach, CA  USA 
http://www.nodeworks.com                1-714-625-4051

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org