Javafx webview не показывает веб -страницу SSRS (решено)JAVA

Программисты JAVA общаются здесь
Anonymous
Javafx webview не показывает веб -страницу SSRS (решено)

Сообщение Anonymous »

Я пытаюсь показать страницу SSRS на веб -просмотре с помощью Javafx. Проблема в том, что, по -видимому, Javafx не хочет, чтобы их разработчики могли отлаживать что -либо, что происходит в их интервью. I can't get the HTTPS error code, I cant get any console output, I tried using JEditorPane with Java Swing and putting it inside JavaFX with a SwingNode but I had no luck since JEditorPane doesn't execute JavaScript, though it actually showed the HTML content, meaning I can get access to it and it's not a 401 error.
Here's the code and the printed output:
// If the category indicates a stampa (print) type, load a web page in a WebView
if (category.toLowerCase().contains("stampa") || category.toLowerCase().contains("stampe")) {
System.out.println("[DEBUG] Category indicates a print type. Proceeding with SSL configuration and WebView setup.");

// Build and debug the URL based on the category
System.out.println("[DEBUG] Building URL based on category.");
String cleanedName = StringUtils.stripAccents(category);
System.out.println("[DEBUG] After stripping accents: " + cleanedName);
cleanedName = WordUtils.capitalize(cleanedName);
System.out.println("[DEBUG] After capitalizing: " + cleanedName);
cleanedName = cleanedName.replaceAll("\\s+", "");
System.out.println("[DEBUG] After removing spaces: " + cleanedName);
String url = "http://DESKTOP-P7MCH3L/ReportServer/Pag ... fia2000%2f"
+ cleanedName + "&rs:Command=Render";
System.out.println("[DEBUG] Final URL: " + url);

// Set the default authenticator with debug logging
System.out.println("[DEBUG] Setting default authenticator.");
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
System.out.println("[DEBUG] getPasswordAuthentication called. Host: " + getRequestingHost() + ", Port: " + getRequestingPort());
return new PasswordAuthentication("DOMAIN\\username", "password".toCharArray());
}
});

// Create and configure the JavaFX WebView with debugging statements
System.out.println("[DEBUG] Creating JavaFX WebView.");
WebView wv = new WebView();
wv.getEngine().setJavaScriptEnabled(true);
System.out.println("[DEBUG] JavaScript enabled in WebView engine.");

// Add listener to log page load status
wv.getEngine().getLoadWorker().stateProperty().addListener((obs, oldState, newState) -> {
System.out.println("[DEBUG] WebView load state changed from " + oldState + " to " + newState);
});

System.out.println("[DEBUG] Loading URL in WebView.");
wv.getEngine().load(url);

// Embed the WebView in the JavaFX scene graph with debug logging
System.out.println("[DEBUG] Embedding WebView into the scene graph.");
root.setCenter(wv);
setContent(root);
System.out.println("[DEBUG] WebView setup complete. Exiting print preview handling.");
return;
}
< /code>
output: < /p>
[DEBUG] Category indicates a print type.
[DEBUG] Building URL based on category.
[DEBUG] After stripping accents: Stampe inquilini
[DEBUG] After capitalizing: Stampe Inquilini
[DEBUG] After removing spaces: StampeInquilini
[DEBUG] Final URL: http://DESKTOP-P7MCH3L/ReportServer/Pag ... and=Render
[DEBUG] Setting default authenticator.
[DEBUG] Creating JavaFX WebView.
[DEBUG] JavaScript enabled in WebView engine.
[DEBUG] Loading URL in WebView.
[DEBUG] WebView load state changed from READY to SCHEDULED
[DEBUG] WebView load state changed from SCHEDULED to RUNNING
[DEBUG] Embedding WebView into the scene graph.
[DEBUG] WebView setup complete. Exiting print preview handling.
[DEBUG] WebView load state changed from RUNNING to CANCELLED

Process finished with exit code 0
< /code>
Я открыт для обходных путей и других решений. Я что -то упускаю в аутентификации? Я могу получить доступ к нему без каких -либо проблем из моего браузера.

Подробнее здесь: https://stackoverflow.com/questions/794 ... age-solved

Вернуться в «JAVA»