Re: Inline generation of error document?

2002-04-20 Thread Issac Goldstand

Bas A.Schulte wrote:

 Hi all,

 On Thursday, April 18, 2002, at 04:58 PM, Geoffrey Young wrote:

 I'm a little confused (honestly). I want to handle parameter errors 
 in a content handler. When there's a parameter missing in the URL, 
 my handler returns HTTP_BAD_REQUEST.
 Now Apache sees the HTTP_BAD_REQUEST return value from my handler 
 and generates an error (HTML) document.
 How can I create this document right from within my handler? I could 
 create another handler of course and use the ErrorDocument directive 
 to point to that but I am wondering if I can do it in my handler 
 directly.
 Somehow I can't find this in the eagle book.


 look for $r-custom_response


 I did, even before my post ;) My confusion was caused by the client 
 testing tool I used: lwp-request. Apparently, it generates 
 HTML-formatted documents in error conditions that *do not come from 
 the webserver*. I was doing something like this:

 $request-custom_response(HTTP_NOT_ACCEPTABLE,'invalid request 
 (application identifier not found)');

 return (HTTP_NOT_ACCEPTABLE);

 Expecting a plain text document in the response. lwp-request however 
 creates an HTML document itself and displays that. Going in with 
 telnet to the appropriate port etc. revealed this was actually working 
 as advertised.

 One of those 'put it in quickly at the end of the day' things ;)

 Bas.


MSIE also overwrites custom responses with built-in ones, per the 
response number.  Netscape and Mozilla are VERY nice, though :-)

  Issac




Inline generation of error document?

2002-04-18 Thread Bas A. Schulte

Hi all,

I'm a little confused (honestly). I want to handle parameter errors in a 
content handler. When there's a parameter missing in the URL, my handler 
returns HTTP_BAD_REQUEST.

Now Apache sees the HTTP_BAD_REQUEST return value from my handler and 
generates an error (HTML) document.

How can I create this document right from within my handler? I could 
create another handler of course and use the ErrorDocument directive to 
point to that but I am wondering if I can do it in my handler directly.

Somehow I can't find this in the eagle book.

Any tips?

Bas.




Re: Inline generation of error document?

2002-04-18 Thread Geoffrey Young



Bas A. Schulte wrote:

 Hi all,
 
 I'm a little confused (honestly). I want to handle parameter errors in a 
 content handler. When there's a parameter missing in the URL, my handler 
 returns HTTP_BAD_REQUEST.
 
 Now Apache sees the HTTP_BAD_REQUEST return value from my handler and 
 generates an error (HTML) document.
 
 How can I create this document right from within my handler? I could 
 create another handler of course and use the ErrorDocument directive to 
 point to that but I am wondering if I can do it in my handler directly.
 
 Somehow I can't find this in the eagle book.


look for $r-custom_response

HTH

--Geiff