Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8088723

iOS: Missing support for jar: URL

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • tbd
    • 9
    • javafx
    • iOS

    • web

      Description from Jarda's email:

      I have a version of Twitter Client demo that runs without Grizzly on the
      desktop (using JavaFX WebView). However the same application shows just an
      empty pane on iOS.

      The reason is my usage of jar:file:.... URL scheme. As the iOS WebUI is a
      native component, it does not understand custom Java URLs and fails to load
      the page. When I replaced the use of jar: URL with load of direct content:

           @Override
      - public void displayPage(final URL resource, Runnable onLoad) {
      + public void displayPage(URL resource, Runnable onLoad) {
      + final StringBuilder sb = new StringBuilder();
      + try {
      + BufferedReader is = new BufferedReader(new
      InputStreamReader(resource.openStream()));
      + for (;;) {
      + String line = is.readLine();
      + if (line == null) {
      + break;
      + }
      + sb.append(line).append('\n');
      + }
      + is.close();
      + } catch (IOException ex) {
      + Exceptions.printStackTrace(ex);
      + }
               engine = FXBrwsr.findEngine(onLoad);
               Platform.runLater(new Runnable() {
                   @Override
                   public void run() {
      - engine.load(resource.toExternalForm());
      + engine.loadContent(sb.toString());
                   }
               });

      the page loads, but it does not read relative resources (like CSS).

      I think it is desirable to have consistent behavior between desktop and iOS
      WebView

            ghb Guru Hb (Inactive)
            rgregor Richard Gregor
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: