The future belongs to those who believe in the beauty of their dreams.Dream BIG!
However , didnot get the expected results.
[My Blog]
All roads lead to JavaRanch
SCJP 5.0(84%), SCWCD 5.0(97%), SCDJWS 5.0(98%)
The future belongs to those who believe in the beauty of their dreams.Dream BIG!
Nabila Mohammad wrote:My Web.xml file :
And My Servlet is :
My Listener Class is :
I got the output :
test context attributes set by listener
Dog's breed is : Great Dane
The result I was expectiing was when i added
System.out.println("In the Dog constructor");
System.out.println("In the getBreed()"); in the Dog class
I expected that that it displays "in the Dog constructor" when Dog object is created in MyServletContextListener and
"in the getBreed()" is displayed when getBreed() is called by the Servlet.
That way i can see the sequence of actions taking place.
Again, I may be asking something pretty silly .. everythign is still hazy in my head and I am not sure how things are working n why we are using it..
But hoping things clear out as i study ahead.
SCDJWS 5.0, SCBCD 5.0, SCWCD 5.0, SCJP 5.0
The future belongs to those who believe in the beauty of their dreams.Dream BIG!
The future belongs to those who believe in the beauty of their dreams.Dream BIG!
Studying ...
I suggest you add a logging tool in your projects, even for tests, or use ServletContext.log("").
The future belongs to those who believe in the beauty of their dreams.Dream BIG!
Studying ...