title: Running a Java Application to run on a tomcat sever
body: <p>I have created a Socket Server application that will accept Client connections from other computers on the local network. This is application is run from a public static void main method. and is a very standard java application.</p>
  
  <p>I have also created a web service that runs on tomcat, it also uses java. The web service will http post accept request from any internet connected device.</p>
  
  <p>Once the web service receives a request I would like it to send instructions through the socket server and send some data to the client connected.</p>
  
  <p>I would like to run the socket server applicaiton within the web service so that the web service has access to the socket server without having to connect as a client.</p>
  
  <p>What is the best way to run a standard java app so that the tomcat server will start the application when it starts up? should i run it as a servlet or is there a better way to have the web service access the socket</p>