Brian Long wrote:
> I don't think you have to do anything beyond declaring your servlet class as
> implementing SingleThreadModel. This informs the web server that you only want to
> process one message at a time. Note that this does not insure threadsafety, in
> that multiple clients will still receive a common copy of common data.
>
> -bml
>
As Brian points out, all you have to do in your servlet is something like:
public class MyServlet implements SingleThreadInterface extends HttpServlet {
...
}
and the servlet container follows the rules about one request at a time. To do the
same thing for a JSP page, use the isThreadSafe attribute on your page directive:
<%@ ... isThreadSafe="no" .. %>
However, I strongly urge you to rethink your design rather than using either approach
to SingleThreadModel. You are going to have to deal with the fact that servlets and
JSP pages run in a multi-threaded environment anyway, so you are better off not
relying on the very small amount of help that SingleThreadModel gives you.
Craig McClanahan
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html