This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes regarding the listener interfaces Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "regarding the listener interfaces" Watch "regarding the listener interfaces" New topic

regarding the listener interfaces

abhishek tiwari

Joined: Aug 08, 2005
Posts: 19
hi guys,
i have some doubts from the chapter on attributes adn listeners.the page number is 182 where the eight listeners have been mentioned along with their functions.following are my queries :-

(a)what is the differnce between a request attribute and a session attribute

(b)for the ServletContextListener interface the scenario mentioned is that it is used to know if a context has been created or can one create/destroy context(i'm not able to get the meaning of context)?

that's it for now.hope you will help me out of this.

thanks in anticipation

when the going gets easy,you are going downhill.......<br /> <br />abhishek tiwari<br />scjp 93%<br />scwcd in progress
Karthik Rajendiran
Ranch Hand

Joined: Aug 13, 2004
Posts: 217
A servlet context exist for a web application per JVM in a distributed environment.

Lets not go to that. In a non-distributed environment, we have Servlet context created by container. if you want to do some operations at the time of servlet context creation,i.e even before the web resource is served to client [client request], like initialising datasource or reading some properties file, you implement the servletContextListener.

Where Session and request can be triggered with respect to client request.

When Request is sent , if the request listener is implemented , the corresponding method is called.

Similarly when the session is created , the sessionCreated method is called.
I think it is more self explanatory.

Can you post your doubt in more detail way?

abhishek tiwari

Joined: Aug 08, 2005
Posts: 19
hi karthik,
first of all thanks for the reply.even i felt that the question was not framed in a proper manner but still you did a good job.

can i have your email id for further correspondence.

my email id is

thanks once again for your instant response[ ]
I agree. Here's the link:
subject: regarding the listener interfaces
It's not a secret anymore!