2

I am trying to display this site: https://harvard.service-now.com/ithelp into my WebView (which is in a JFXPanel). However, it showing a blank screen. I tried several different pages and they all works fine to me.

Searching around suggest that it is a certificate issue. However I tried to fix it using this: JavaFX WebView can't load certain sites and it still does not work.

This is also what I am getting when listening for an error event:

ReadOnlyObjectProperty [bean: javafx.scene.web.WebEngine$LoadWorker@36ecd1f, name: exception, value: null]

Code:

Platform.runLater(() -> {

        WebView webView = new WebView();
        webPanel.setScene(new Scene(webView));
        webView.setZoom(1.6);
        webView.getEngine().load("https://harvard.service-now.com/ithelp");
        webView.getEngine().getLoadWorker().stateProperty()
                .addListener((ov, oldState, newState) -> {
                    System.err.println(webView.getEngine().getLoadWorker()
                             .exceptionProperty());
                });
    });

Additionally, the website takes Firefox, Edge, Chrome, and Edge a bit of time to load so I don't know if it has anything to do with WebView.

Nguyễn Duy
  • 91
  • 1
  • 8
  • 1
    Well I can't give you an answer, I just want to point out that if you try to load "https://harvard.service-now.com" you will see a security error, so your request to /ithelp is been blocked. No it's because certification? browser? I don't really know. – JKostikiadis Oct 03 '17 at 23:04
  • Can you please elaborate a little more on that? Like how did you see the security error? On the java client? System error or Browser? Thank you! Also, I am starting to think that it is because that is a web app? (not sure if it is though) – Nguyễn Duy Oct 04 '17 at 02:16
  • Sorry it was late at night so my answer was quick :P. Actually if you try to load it with WebView the site will load giving you an error about security. Maybe their site/app blocks suspicious( ex. unsupported browsers) https requests. You should wait for someone more knowledgeable in this field than me to help you ;) – JKostikiadis Oct 04 '17 at 09:46
  • Can you give me a screenshot of that? Because for me it is literally just a blank screen. – Nguyễn Duy Oct 04 '17 at 13:56
  • Sure here you are : https://imgur.com/3NCKrVG – JKostikiadis Oct 04 '17 at 14:03
  • Oh, I did not read your comment carefully. That is the expected behavior of https://harvard.service-now.com (it requires you to log in same thing will happen in any browser) . However, https://harvard.service-now.com/ithelp should load regardless of which browser (at least the known one, therefore the possibility of unrecognized browser is not excluded) Can you try https://harvard.service-now.com/ithelp and let me know what do you get? Thank you! – Nguyễn Duy Oct 04 '17 at 17:23
  • I have already did. Just an empty page. I don't really know why. I hope someone else here can help you. – JKostikiadis Oct 04 '17 at 17:33

0 Answers0