Susie Itzkowitz wrote:
>
> We are having a problem once in awhile such
> that the HttpServletResponse is being
> swapped between users. For example, a user is expecting a response to a
> request submitted & will receive a response of
> another user. Is it possible that there is some sort of threading problem?
It certainly sounds like a threading problem. It probably has nothing to
do with the Request or Response or session tracking. Let me guess,
you're doing something like this:
public class SusieServlet extends HttpServlet {
private PrintWriter out;
public void doPost(HttpServletRequest req, HttpServletResponse) {
//get the session, do other processing..... then
response.setContentType("text/html");
out = response.getWriter();
//output the response
}
}
The above is not thread safe because it is using a member variable that
gets changed by every thread that enters the servlet. If two threads
enter the servlet at the same time, each thread will set the PrintWriter
variable. This is a common problem to the symptom you described. If you
are using variables which can be changed by a thread, you should change
to using local variables, or protect access to those variables.
K Mukhar
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html