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 destroyed.how 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
Hello, 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?
SCJP 1.4 SCWCD 1.4 SCDJWS 1.4
Joined: Aug 08, 2005
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.