jsr340-experts@servlet-spec.java.net

[jsr340-experts] Re: SERVLET_SPEC-23: Help prevent infinite loops

From: Shing Wai Chan <shing.wai.chan_at_oracle.com>
Date: Wed, 21 Dec 2011 17:21:31 -0800

On 12/17/11 1:16 PM, Mark Thomas wrote:
> On 15/12/2011 21:22, Alex Rojkov wrote:
>>>> Hi,
>>>> I am looking at http://java.net/jira/browse/SERVLET_SPEC-23
>>>> I plan to throw IllegalArgumentException when an infinite loop is detected.
>>>> If you have any comment, then please let me know.
>>> There are already dubious checks required in the request dispatcher by
>>> the specification, which have a cost. I would like to avoid adding
>>> additional pointless checks.
>> +1
> Fair point. This is certainly adding overhead to try and attempt to
> prevent users shooting themselves in the foot.
>
> If we can get into the spec that IllegalArugmentException may (rather
> than must) be thrown at this point if invalid/silly input is provided,
> then we can leave it up to the containers to decide how much checking
> they want to provide in what circumstances.
>
> Mark
The check should not be complicated or too costly as each corresponding
vertex has only one outgoing edge
and also in general there is not too many vertex in the corresponding graph.
But I understand the concern that it may introduce an overhead (no
matter how small it is).
I prefer either check it or do not check it.

Shing Wai Chan