I have asked this question a couple of times in here with no replies. I have two separate contexts with the same class. The class has a static variable and I would like to have different static variables across contexts. the source to an example class is as follows: public class StaticTest extends HttpServlet { private static int test = 0; public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { response.getWriter().println(getTest()); } public static int getTest() { if (test == 0) test = new Random().nextInt(); return test; } } It appears to work as I expect with a different number for each context it is placed in on a windows platform, but on linux, the numbers returned are the same and the static is set once! should it be? thanks Zach
- Re: multiple context paths pointing to the same ... Craig R. McClanahan
- Re: multiple context paths pointing to the s... Vladimir Grishchenko
- Re: multiple context paths pointing to t... Craig R. McClanahan
- Re: multiple context paths pointing ... Vladimir Grishchenko
- Re: multiple context paths poin... Dmitri Colebatch
- Re: multiple context paths poin... Craig R. McClanahan
- Re: multiple context paths poin... Dmitri Colebatch
- Connection pooling Question A.L.
- RE: Connection pooling Question Filip Hanik
- Re: Connection pooling Question Bo Xu
- Re: static variables in multiple contexts PLEASE HEL... Zach Hollandsworth
- Re: static variables in multiple contexts PLEAS... Craig R. McClanahan
- RE: static variables in multiple contexts P... Zach Hollandsworth
- RE: static variables in multiple context... Craig R. McClanahan
- RE: static variables in multiple con... Zach Hollandsworth