Hello there,
There might be a better way, but one simple thing you could do is
give the servlet a hashtable that maps session IDs to counts.
Willie
On Fri, 5 Nov 1999, Vaibhav Bhanot wrote:
> 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