I didn't know about this new class. It's definitely a much better solution.
Thanks for the tip.
David
----- Original Message -----
From: Kevin Jones <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, November 06, 1999 12:16 PM
Subject: Re: Help really urgent !!!
> Or you could just use the new ThreadLocal class in Java 2 to achieve the
> same thing,
>
> Kevin
>
> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of David Chisholm
> Sent: 05 November 1999 14:58
> To: [EMAIL PROTECTED]
> Subject: Re: Help really urgent !!!
>
>
> I don't know why you want to do this, but theoretically you can do it by:
>
> - getting the current thread object with Thread.currentThread()
>
> - use a hashtable to store (Thread object, count object) pairs. Note that
> count is now an Integer object and not an int.
>
> - use the hashtable to lookup a count object for the current thread;
create
> a new Integer object; assign it the incremented value of the old count;
and
> put the new count into the hashtable
>
> David
>
>
>
>
> > -----Original Message-----
> > From: A mailing list about Java Server Pages specification and reference
> > [mailto:[EMAIL PROTECTED]]On Behalf Of Vaibhav Bhanot
> > Sent: Friday, November 05, 1999 3:54 AM
> > To: [EMAIL PROTECTED]
> > Subject: Help really urgent !!!
> >
> >
> > This is something really urgent...could anybody please guide me what
> > should i do...i am sending u what exactly i want and what is
> > happening....here is an example below which increments value of variable
> > count and it is accessible to every thread...now i want count variable
> > to be different for different threads...could u please guide me what are
> > the approaches available
> > to implement this except for putting "count" variable in the
> > session....
> >
> > Thanks in advance !!!
> >
> > Vaibhav
> >
> >
> > import java.io.*;
> > import javax.servlet.*;
> > import javax.servlet.http.*;
> >
> > public class RefreshServlet extends HttpServlet
> > {
> > int count=0;
> > public void init(ServletConfig config) throws ServletException
> > {
> > super.init(config);
> > }
> >
> > public void doGet(HttpServletRequest req, HttpServletResponse resp)
> > throws ServletException, IOException
> > {
> > resp.setContentType("text/html");
> > PrintWriter out = new PrintWriter(resp.getOutputStream());
> >
> >
> > out.println("<HTML>");
> > out.println("<HEAD><TITLE>RefreshServlet Output</TITLE></HEAD>");
> > out.println("<BODY>");
> >
> > count++;
> >
> > out.println("The count is "+count);
> >
> > out.println("</BODY>");
> > out.println("</HTML>");
> > out.close();
> > }
> >
> > }
> >
> >
> >
> >
> > Could you please suggest me what should i do to counter this....coz i do
> >
> > want different variables for different threads...
> >
> > Thanks in advance
> >
> > Vaibhav
> >
> > ==================================================================
> > =========
> > 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
> >
>
>
===========================================================================
> 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
>
>
===========================================================================
> 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
>
===========================================================================
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