Let me add "as well as AsyncListener."Any class annotated with WebListener must implement one or more of the ServletContextListener, ServletContextAttributeListener, ServletRequestListener, ServletRequestAttributeListener, HttpSessionListener or HttpSessionAttributeListener interface.
About Question enthuware.jwpv6.2.582 :
Moderator: admin
-
- Posts: 358
- Joined: Fri Nov 29, 2013 8:26 pm
- Contact:
About Question enthuware.jwpv6.2.582 :
Let me add one more listener:
-
- Site Admin
- Posts: 10209
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.jwpv6.2.582 :
JavaDoc description of this annotation doesn't mention AsyncListener: https://docs.oracle.com/javaee/6/api/ja ... tener.html
If you like our products and services, please help us by posting your review here.
-
- Posts: 197
- Joined: Mon Jun 20, 2016 5:06 pm
- Contact:
Re: About Question enthuware.jwpv6.2.582 :
Any class annotated with WebListener must implement one or more of the ServletContextListener, ServletContextAttributeListener, ServletRequestListener, ServletRequestAttributeListener, HttpSessionListener or HttpSessionAttributeListener interface.
Where did you get this requirement? Could you please indicate source?
Where did you get this requirement? Could you please indicate source?
-
- Site Admin
- Posts: 10209
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.jwpv6.2.582 :
Section 8.1.4, Servlet 3.0 specification.johnlong wrote:Any class annotated with WebListener must implement one or more of the ServletContextListener, ServletContextAttributeListener, ServletRequestListener, ServletRequestAttributeListener, HttpSessionListener or HttpSessionAttributeListener interface.
Where did you get this requirement? Could you please indicate source?
HTH
Paul.
If you like our products and services, please help us by posting your review here.
-
- Posts: 197
- Joined: Mon Jun 20, 2016 5:06 pm
- Contact:
Re: About Question enthuware.jwpv6.2.582 :
Thanks.
1. I have annotated my class @WebListener and my class implements AsyncListener and works fine.
2. Also I am able to annotate my class @WebListener not implementing any Listener interfaces at all.
1. I have annotated my class @WebListener and my class implements AsyncListener and works fine.
2. Also I am able to annotate my class @WebListener not implementing any Listener interfaces at all.
-
- Site Admin
- Posts: 10209
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.jwpv6.2.582 :
Some times servlet containers fail to adhere to the specification 100%. The reason could be a mistake or something that only they can tell.
If you like our products and services, please help us by posting your review here.
-
- Posts: 197
- Joined: Mon Jun 20, 2016 5:06 pm
- Contact:
Re: About Question enthuware.jwpv6.2.582 :
Ok, but then according to specification we cannot annotate AsyncListener as @WebListener?
-
- Site Admin
- Posts: 10209
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.jwpv6.2.582 :
You can annotate any class with @WebListener if the class implements one of the valid interfaces for being a web listeners i.e. HttpServletListener, ContextListener etc.
If you like our products and services, please help us by posting your review here.
-
- Posts: 197
- Joined: Mon Jun 20, 2016 5:06 pm
- Contact:
Re: About Question enthuware.jwpv6.2.582 :
I am very sorry, I did not get your last explanation.
Who is online
Users browsing this forum: No registered users and 2 guests