@restlet.tigris.org
Objet : Re: Aborting request in Filter
By the way, in the doHandle() method, if there isn't a next Restlet,
the method sets the response to CLIENT_ERROR_NOT_FOUND. Shouldn't
that be SERVER_ERROR_INTERNAL because the programmer goofed by not
setting a next Restlet?
- Paul
: Aborting request in Filter
Hi Stephan,
I agree, using enums here makes sense.
Best regards,
Jerome
2008/1/11, Stephan Koops [EMAIL PROTECTED] :
What about using the enum instead of ints for the
result? They are
founded for this feature. ints can be directly compared
Sorry for not commenting earlier, but
Anyway, in thinking about this more, I don't think a filter should
have any knowledge of its next filter. When a request is received,
the engine should have a list of filters, i.e., the list itself
should be external to all the filters.
So,
What about using the enum instead of ints for the result? They are
founded for this feature. ints can be directly compared ( if(result =
SKIP) or something like that). I don't know if it is possible for enums.
Stephan
Jerome Louvel schrieb:
Instead, we could become more precise and return an
Hi Stephan,
I agree, using enums here makes sense.
Best regards,
Jerome
2008/1/11, Stephan Koops [EMAIL PROTECTED]:
What about using the enum instead of ints for the result? They are
founded for this feature. ints can be directly compared ( if(result =
SKIP) or something like that). I
Well, if you want to post-process a request in error, you need to
distinguish that case from the case where you don't want to post-
process in error.
Another problem is that the current doHandle() calls next.handle()
and that doesn't return a boolean to indicate whether to do post-
Jerome,
What's the advantage of Filter.handle being final?
- R
Hi Paul,
Well, if you want to post-process a request in error, you need to
distinguish that case from the case where you don't want to post-
process in error.
Another problem is that the current doHandle() calls next.handle()
and that doesn't return a boolean to indicate whether to do post-
By the way, in the doHandle() method, if there isn't a next Restlet,
the method sets the response to CLIENT_ERROR_NOT_FOUND. Shouldn't
that be SERVER_ERROR_INTERNAL because the programmer goofed by not
setting a next Restlet?
- Paul
If I write my own filter and use its beforeHandler(), I would like,
upon some catastrophe, to abort the entire request and return some
client error code.
Unfortunately, it doesn't appear that the API for Filter allows
aborting a request. True?
This is another good case for using
10 matches
Mail list logo