friends i have created HttpServletRequest and HttpServletResponse object's reference variables but creates objects in do post and other methods does it affect my code and is it possible that i face threading problems i think yes and if yes what step should i follow to avoid data corruption
Data that changes 'per user', ie, data for individual users(login name, default language etc) should not be stored in instance variables since, like mentioned above, this data is not thread safe. This kind of data should always be declared/initialiased in the service()(or doGet()/DoPost() etc) methods.
Whereas generic data, or data common to all users, (Eg: list of holidays for the organisation) should be declared as instance variables since this is not required to be different for every user. [ September 08, 2005: Message edited by: Neeraj Dheer ]
subject: question on instance variables in servlets