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

iOS: Missing support for jar: URL

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 9
    • Fix Version/s: tbd
    • Component/s: javafx
    • Labels:
    • Environment:

      iOS

    • Subcomponent:
      web

      Description

      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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported: