First of all, you don't "execute a HashMap." You access one.
Are you talking about actual synchronization, or the order in which entries are retrieved? Arrays aren't synchronized either, so... so far what you're saying isn't making any sense.
Are you adding to it, removing from it, reading values from it, all three?
Where is this hashmap created?
Is it bound to a particular scope object?
Did you declare it right in the JSP?
If so, was it created outside of the service area (within <%! %> tags?).
Tell us a little more about what you are doing, what you are expecting, and what you're seeing and we can probably point out what is going wrong.
Lalchand omprakash wrote:yeah i have used the Hash map for the purpose of reading,writing the data. i have placed the hash map in "<% %>" scriplet along with code that will iterate over the collection. i think due to multiple request to the jsp page data race occurring in the jsp. i have tried synchronization is there any other way to avoid the data race problem.
I'm not sure why you didn't answer my original question, or the questions asked by Ben.
What is happening? What do you *expect* to happen? Under what circumstances do you see the problem?
Please, *please* answer those questions--otherwise we're just guessing.
Lalchand omprakash wrote: i have placed the hash map in "<% %>" scriplet along with code that will iterate over the collection.
If you have declared the map inside a set of <% ... %> tags then a new map will be created for each request and there will be no race condition between multiple requests.
"Placed" doesn't tell me whether this is the case or not.
As David mentioned, you really need to answer the questions asked of you fully.
Until you do that, nobody is going to be able to give you any meaningful help here.