1

I am trying to load https://www.paytm.com and search some products in webview but facing following problems in it. 1.It is not loading images in home page 2.If I search any products in search box window is getting stuck and not giving any results 3.if I click any product link, in status bar it showing as finished but nothing is displayed/rendered in page

 private void Pageload() {
        // Create a trust manager that does not validate certificate chains
        TrustManager[] trustAllCerts = new TrustManager[] {
            new X509TrustManager() {
                public java.security.cert.X509Certificate[] getAcceptedIssuers() {
                    return null;
                }
                public void checkClientTrusted(
                    java.security.cert.X509Certificate[] certs, String authType) {
                    }
                public void checkServerTrusted(
                    java.security.cert.X509Certificate[] certs, String authType) {
                }
            }
        };

        // Install the all-trusting trust manager
        try {
            SSLContext sc = SSLContext.getInstance("SSL");
            sc.init(null, trustAllCerts, new java.security.SecureRandom());
            HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
        } catch (Exception e) {
             System.out.println(e);
        }

        //now you can load the content:

        String url = makeUrl(textField.getText()) ;
        webView.getEngine().load(url);
        textField.setText(url);

    }

All other sites are working fine including google,gmail. I am aware that the way I am creating trust manager to trust all is not a good practice, this is only for testing so I am doing it.

Jeya Kumar
  • 1,002
  • 1
  • 13
  • 36
  • 1
    All that are you doing is fine, simple, javafx-webview don't support all elements from web. Check this question http://stackoverflow.com/questions/37340274/javafx-embedding-a-browser-other-than-available-webview-with-javafx and then you will answer yourself. – Vladlen Gladis Oct 07 '16 at 08:24
  • 1
    I used electron as alternative for JavaFx to create desktop based application https://electron.atom.io/.If some one is looking alternate try electron – Jeya Kumar Jun 17 '17 at 13:43

0 Answers0