Hi,
What do you think about implementing such a simple boot project? I was
able create an embedded Jetty server with these lines:
public static void main(String[] args) throws Exception {
int port = 8080;
if (args.length == 2 && "--port".equals(args[0])) {
port = Integer.parseInt(args[1]);
}
LOG.info("Running Http server on port " + port);
Server server = new Server();
ServerConnector connector = new ServerConnector(server);
connector.setPort(port);
HttpConfiguration https = new HttpConfiguration();
https.addCustomizer(new SecureRequestCustomizer());
WebAppContext context = new WebAppContext();
context.setServer(server);
context.setContextPath("/");
ProtectionDomain protectionDomain = App.class.getProtectionDomain();
URL location = protectionDomain.getCodeSource().getLocation();
context.setWar(location.toExternalForm());
server.setHandler(context);
while (true) {
try {
server.start();
break;
} catch (Exception e) {
e.printStackTrace();
}
}
try {
System.in.read();
server.stop();
server.join();
} catch (Exception e) {
e.printStackTrace();
System.exit(100);
}
}
Regards
--
Ćukasz
+ 48 606 323 122 http://www.lenart.org.pl/
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]