Re: Duplicate registration of ServletContextListerner

2018-07-27 Thread Mark Thomas
On July 27, 2018 1:53:40 AM UTC, Huxing Zhang wrote: >What if the listener isn't in control, e.g. the listener class is in a >3rd party library. >In some cases, a listener may not allow multiple instances, if the >second listener start, it will fail. Raise a bug against the 3rd party library?

Re: Duplicate registration of ServletContextListerner

2018-07-26 Thread Huxing Zhang
On Fri, Jul 27, 2018 at 3:02 AM, Mark Thomas wrote: > On July 26, 2018 6:08:09 PM UTC, Christopher Schultz > wrote: >>-BEGIN PGP SIGNED MESSAGE- >>Hash: SHA256 >> >>Mark, >> >>On 7/26/18 5:21 AM, Mark Thomas wrote: >>> On 26/07/2018 04:29, Huxing Zhang wrote: Hi, On Thu, J

Re: Duplicate registration of ServletContextListerner

2018-07-26 Thread Mark Thomas
On July 26, 2018 6:08:09 PM UTC, Christopher Schultz wrote: >-BEGIN PGP SIGNED MESSAGE- >Hash: SHA256 > >Mark, > >On 7/26/18 5:21 AM, Mark Thomas wrote: >> On 26/07/2018 04:29, Huxing Zhang wrote: >>> Hi, >>> >>> On Thu, Jul 26, 2018 at 2:57 AM, Christopher Schultz >>> wrote: >> >> >

Re: Duplicate registration of ServletContextListerner

2018-07-26 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Mark, On 7/26/18 5:21 AM, Mark Thomas wrote: > On 26/07/2018 04:29, Huxing Zhang wrote: >> Hi, >> >> On Thu, Jul 26, 2018 at 2:57 AM, Christopher Schultz >> wrote: > > > >>> Can you think of a use-case where addListener() shouldn't >>> automa

Re: Duplicate registration of ServletContextListerner

2018-07-26 Thread Mark Thomas
On 26/07/2018 04:29, Huxing Zhang wrote: Hi, On Thu, Jul 26, 2018 at 2:57 AM, Christopher Schultz wrote: Can you think of a use-case where addListener() shouldn't automatically perform de-duplication? No, I can't think of that case. Yes, although only for the programmatic case. Multip

Re: Duplicate registration of ServletContextListerner

2018-07-25 Thread Huxing Zhang
Hi, On Thu, Jul 26, 2018 at 2:57 AM, Christopher Schultz wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA256 > > Huxing, > > On 7/25/18 11:28 AM, Huxing Zhang wrote: >> Hi, >> >> Recently I am working on implementing a feature that can >> automatically register a ServletContextListerner in

Re: Duplicate registration of ServletContextListerner

2018-07-25 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Huxing, On 7/25/18 11:28 AM, Huxing Zhang wrote: > Hi, > > Recently I am working on implementing a feature that can > automatically register a ServletContextListerner instance, say A, > to servletContext programmatically during startup. > > I use

Duplicate registration of ServletContextListerner

2018-07-25 Thread Huxing Zhang
Hi, Recently I am working on implementing a feature that can automatically register a ServletContextListerner instance, say A, to servletContext programmatically during startup. I use ServletContainerInitializer and call the servletContext.addListener() method. This is fine for most of the cases.