diff -r d6b1f996c0d8 -r c50c541368f8 launcher/src/main/java/org/apidesign/bck2brwsr/launcher/Bck2BrwsrLauncher.java --- a/launcher/src/main/java/org/apidesign/bck2brwsr/launcher/Bck2BrwsrLauncher.java Wed Jan 16 12:25:50 2013 +0100 +++ b/launcher/src/main/java/org/apidesign/bck2brwsr/launcher/Bck2BrwsrLauncher.java Wed Jan 16 12:27:53 2013 +0100 @@ -247,20 +247,14 @@ URI uri = new URI("http://localhost:" + port + page); LOG.log(Level.INFO, "Showing {0}", uri); -// try { -// Desktop.getDesktop().browse(uri); -// return null; -// } catch (UnsupportedOperationException ex) - { -// File dir = File.createTempFile("chrome", ".dir"); -// dir.delete(); -// dir.mkdirs(); -// String[] cmd = { -// "google-chrome", "--user-data-dir=" + dir, "--app=" + uri.toString() -// }; -// LOG.log(Level.INFO, "Launching {0}", Arrays.toString(cmd)); -// final Process process = Runtime.getRuntime().exec(cmd); -// return new Object[] { process, dir }; + if (cmd == null) { + try { + java.awt.Desktop.getDesktop().browse(uri); + LOG.log(Level.INFO, "Desktop.browse successfully finished"); + return null; + } catch (UnsupportedOperationException ex) { + LOG.log(Level.INFO, "Desktop.browse not supported", ex); + } } { String cmdName = cmd == null ? "xdg-open" : cmd; @@ -375,8 +369,13 @@ r = r.substring(1); } } - if (r.endsWith(".html") || r.endsWith(".xhtml")) { + if (r.endsWith(".html")) { response.setContentType("text/html"); + LOG.info("Content type text/html"); + } + if (r.endsWith(".xhtml")) { + response.setContentType("application/xhtml+xml"); + LOG.info("Content type application/xhtml+xml"); } OutputStream os = response.getOutputStream(); try (InputStream is = res.get(r)) {