Created
June 18, 2014 14:22
-
-
Save kellegous/bf7bc6d3bd44ffc21481 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; | |
import javax.servlet.ServletException; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; | |
import org.eclipse.jetty.server.Request; | |
import org.eclipse.jetty.server.Server; | |
import org.eclipse.jetty.server.handler.AbstractHandler; | |
public class HelloHttp { | |
public static void main(String[] args) throws Exception { | |
Server server = new Server(0x420); | |
server.setHandler(new AbstractHandler() { | |
@Override | |
public void handle(String target, Request r, HttpServletRequest req, | |
HttpServletResponse res) throws IOException, ServletException { | |
r.setHandled(true); | |
} | |
}); | |
server.start(); | |
server.join(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment