hi all,
in Head First servlets and jsp book it was given like this .A seperate thread is created on every request, and before service() method called a seperate thread is created and control is transferred to service() method().
Does this mean remaining parts of servlet are shared by multiple threads
simultaniously ?
If I declare a HashMap in a servlet class as an instance variable then will it be shared by multiple threads .
I refer this HashMap in doPost()
eg
please tell in the above example if the HashMap h is shared by multiple threads .Is this the proper place to declare a HashMap in a servlet.
my application requirement after upload keep track of all uploaded file in a HashMap .So that when a user tries to delete using a link in the html page servlet shud delete that file only in the file system.
[ December 16, 2008: Message edited by: vijaya saradhi ]
in Head First servlets and jsp book it was given like this .A seperate thread is created on every request, and before service() method called a seperate thread is created and control is transferred to service() method().
Does this mean remaining parts of servlet are shared by multiple threads
simultaniously ?
If I declare a HashMap in a servlet class as an instance variable then will it be shared by multiple threads .
I refer this HashMap in doPost()
eg
please tell in the above example if the HashMap h is shared by multiple threads .Is this the proper place to declare a HashMap in a servlet.
my application requirement after upload keep track of all uploaded file in a HashMap .So that when a user tries to delete using a link in the html page servlet shud delete that file only in the file system.
[ December 16, 2008: Message edited by: vijaya saradhi ]