Using simple name should allow us to support multiple pages in the future emul
authorJaroslav Tulach <jaroslav.tulach@apidesign.org>
Fri, 15 Feb 2013 19:28:31 +0100
branchemul
changeset 7423035beed09a1
parent 741 1343f52164f3
child 743 6dc02c92ba9e
Using simple name should allow us to support multiple pages in the future
launcher/src/main/java/org/apidesign/bck2brwsr/launcher/Bck2BrwsrLauncher.java
     1.1 --- a/launcher/src/main/java/org/apidesign/bck2brwsr/launcher/Bck2BrwsrLauncher.java	Fri Feb 15 19:24:34 2013 +0100
     1.2 +++ b/launcher/src/main/java/org/apidesign/bck2brwsr/launcher/Bck2BrwsrLauncher.java	Fri Feb 15 19:28:31 2013 +0100
     1.3 @@ -95,10 +95,12 @@
     1.4              startpage = "/" + startpage;
     1.5          }
     1.6          HttpServer s = initServer(".", true);
     1.7 -        s.getServerConfiguration().addHttpHandler(new Page(resources, startpage), "/index.xhtml");
     1.8 +        int last = startpage.lastIndexOf('/');
     1.9 +        String simpleName = startpage.substring(last);
    1.10 +        s.getServerConfiguration().addHttpHandler(new Page(resources, startpage), simpleName);
    1.11          s.getServerConfiguration().addHttpHandler(new Page(resources, null), "/");
    1.12          try {
    1.13 -            launchServerAndBrwsr(s, "/index.xhtml");
    1.14 +            launchServerAndBrwsr(s, simpleName);
    1.15          } catch (URISyntaxException | InterruptedException ex) {
    1.16              throw new IOException(ex);
    1.17          }