Florian D Florian D - 3 months ago 89
Java Question

JavaFX blank site

I want display the website "https://www.dazn.com/" in an JavaFX Webview, but all I get is a blank page.

In my little test applicatoin, every website (e.g. https://www.google.com or https://www.facebook.com) works. But "dazn.com" don't work.

Here is my code:

@Override
public void start(final Stage primaryStage) throws Exception {
System.setProperty("jsse.enableSNIExtension", "false");
System.setProperty("sun.net.http.allowRestrictedHeaders", "true");

Scene scene = new Scene(new Group());
final WebView webView = new WebView();
final WebEngine webEngine = webView.getEngine();
webEngine.setJavaScriptEnabled(true);

ScrollPane scrollPane = new ScrollPane();
scrollPane.setContent(webView);
scrollPane.setFitToHeight(true);
scrollPane.setFitToWidth(true);

webEngine.load("https://www.dazn.com");

scene.setRoot(scrollPane);
primaryStage.setScene(scene);
primaryStage.setFullScreen(false);
primaryStage.show();
}


Java Version: 1.8.0_112-ea-b04

JavaFX Version: 8.0.112-ea-b04

OS: Windows 8.1, amd64

User Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/602.1 (KHTML, like Gecko) JavaFX/8.0 Safari/602.1

Thank's a lot!

Answer

Just remove this line and the webpage loads.

    System.setProperty("jsse.enableSNIExtension", "false");