> For threading, as you mentionned, there should be one-to-one mapping (one
> HTTP request = one HttpServletRequest = one thread).
Is your servlet implementing SingleThreadModel
> My feeling is that it's not illegal but rather unsafe. Which is yours as
> well, but I'd like to find literature about this (spec, post, article, blog,
> etc).
It is unsafe I suppose. Suppose, your servlet is executing, and
dispatches the request at the end of the processing, with the request
and response, to a JSP. Now when jsp page is submitted, request will
have a new set of parameters. If your another thread is still using the
request, there are chances of it finding changed /inconsistent data, if
it still has not finished execution, and the user is fast enough.
Try something else.
Ben_ - 30 Sep 2005 06:39 GMT
> Is your servlet implementing SingleThreadModel
No.
> It is unsafe I suppose. Suppose, your servlet is executing, and
> dispatches the request at the end of the processing, with the request
> and response, to a JSP. Now when jsp page is submitted, request will
> have a new set of parameters. If your another thread is still using the
> request, there are chances of it finding changed /inconsistent data, if
> it still has not finished execution, and the user is fast enough.
Mmmh, yes, it's a possible weird cause. I'll think at it. Thx.
> Try something else.
What do you mean ?
HalcyonWild - 30 Sep 2005 10:50 GMT
> > Try something else.
>
> What do you mean ?
This.
Can you do your work without the thread. If not, consider using
Thread.join() in your scenario, so that the servlet thread waits for
the other thread to finish.