0 Replies Latest reply: Jan 22, 2013 10:02 AM by 984052 RSS

    [WebView] external HTML loaded, but without styles and scripts...?

      Hello again :)

      I am using WebView to load an external HTML document for layouting and styling my application. Thereby I generated an executable .jar to use this as a sstand alone application. Here it snaps.

      When I load the HTML, its loaded without styles and scripts, mentioned in the <head> part of the doc. Scripts, pics and styles are referenced relatively. That works indeed: laoding the doc in Chrome results in a fully functional website, but doing so with the .jar does not.

      This is how I load the page:
      URL markupURL = null;          
      markupURL = getClass().getResource("/mockup.html");
      Thats how the styles are linked in the HTML:
      <link rel="stylesheet" type="text/css" href="css/bootstrap.css">
      <link rel="stylesheet" type="text/css" href="css/metrostyle.css">
      So consider the following folder structure:

      - commport
      # mochup.html
      # comm.jar
      - css
      # bootstrap.css
      # metrostyle.css


      I repeat: this structure works in a browser. Why not in the jar?

      thanks :)

      Edited by: W4tson on 22.01.2013 16:59

      Edited by: W4tson on 22.01.2013 17:02