I'm creating a web application with servlets and I need a thread changing a number constantly and when a client do a request it gets the current number.
I tried creating a class with the main method and from there start the thread, then from the servlet get the instance where the thread is running (can this be possible?), but the application never enters to the main method.
Any suggestions? Thanks