Suppose that Myservlet implements SingleThreadModel. and there are Local variables Instance variables Class variables Request attributes Session attributes Context attributes Which among these variables would be thread safe Select any one A Local and Request Variables B Local,Instance and request variables C Local,Instance,request,class variables D None of these I donot know the correct answer but I think it shud be A Can anyone correct me if I am wrong?
SCJP,SCWCD,SCBCD<br />If Opportunity doesn't knock then build the door
Local variables will be ridded of by the time the method returns so there's no worrying about other threads. From the servlet specification (regarding static variables): "The SingleThreadModel interface does not prevent synchronization problems that results from servlets accessing shared resources such as static class variables or classes outside the scope of the servlet".
Sun Certified J2EE Architect for the J2EE Platform (Part 1)<br />Sun Certified Web Component Developer for the J2EE Platform<br />Sun Certified Programmer for the Java 2 Platform
You can thank my dental hygienist for my untimely aliveness. So tiny:
Devious Experiments for a Truly Passive Greenhouse!