Hi Chang,
Thanks for the info.
We would clarify the spec about IllegalArgumentException.
Thanks.
Shing Wai Chan
On 2/22/12 8:25 PM, chang paek wrote:
> Hi, EG members,
>
> My colleague found spec and API mismatch and I am forwarding his report.
> Please look into this report.
>
> Regards,
>
> Chang.
>
>
> ---------- Forwarded message ----------
> From: *Eu-gene Chung*<euigeun_chung_at_tmax.co.kr
> <mailto:euigeun_chung_at_tmax.co.kr>>
> Date: 2012/2/23
> Subject: [Servlet 3.0 Spec] unmatched contents between ServletContext
> API and Spec. Document
> To: ¹éâÇö <changhyun_paek_at_tmax.co.kr <mailto:changhyun_paek_at_tmax.co.kr>>
> Cc: was1_at_tmax.co.kr <mailto:was1_at_tmax.co.kr>
>
>
> Mr, Paek. Please forward this e-mail to EG.
>
>
> I found that there were unmatched contents between ServletContext API
> and Spec. Document.
>
> API
>
> public void addListener(Class <? extends EventListener> listenerClass);
>
> * @throws IllegalArgumentException if the given <tt>listenerClass</tt>
> * does not implement any of the above interfaces, or if it implements
> * {_at_link ServletContextListener} and this ServletContext was not passed
> * to {_at_link ServletContainerInitializer#onStartup}
>
> Spec. Document
>
> 4.4.3.1 void addListener(String className)
>
> If the ServletContext was passed to the ServletContainerInitializer¡¯s
> onStartup method, then the class with the given name MAY also implement
> javax.servlet.ServletContextListener in addition to the interfaces listed
> above.
>
>
>
> API says that the method throws IllegalArgumentException if
> ServletContextListener is NOT added by
> ServletContainerInitializer#onStartup.
> But Spec. Document says that it can be tolerant.
> This unmatched explanation can also be found in other addListener methods.
>
>
> --
> Best regards,
> Eugene Chung (Korean : Á¤ÀDZÙ)
>