users@jersey.java.net

Sun's lightweight built in HttpServer hangs on windows

From: William Brogden <wbrogden_at_bga.com>
Date: Mon, 31 Mar 2008 11:13:26 -0500

So the villain is System.in.read - I am surprised.

Here is what I used to get it running!!

          System.out.println("Server running");
          System.out.println("Visit:
http://localhost:9998/matching/domain/word");
          System.out.println("Hit ^C to stop...");
          boolean running = true ;
          while( running ){
             try { // sleep one second
               Thread.sleep( 1000 ) ;
             }catch( InterruptedException e ){
               System.out.println("Interrupted");
               running = false ;
             }
           }

-------------
^C just kills the whole thing, the System.out.println("Interrupted")
never runs so I suppose I could have just used sleep with a really long
value.

Bill