Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature currently requires accessing the site using the built-in Safari browser.
class DateHandler implements HttpHandler
{
public void handle( HttpExchange httpExchange ) throws IOException
{
httpExchange.getResponseHeaders().add( "Content-type", "text/html" );
String response = "<b>" + new Date() + "</b> for " +
httpExchange.getRequestURI();
httpExchange.sendResponseHeaders( 200, response.length() );
OutputStream os = httpExchange.getResponseBody();
os.write( response.getBytes() );
os.close();
}
}