HTTP 4xx handling in WebView

Post here questions and problems related to oXygen frameworks/document types.
willy_mwangi
Posts: 4
Joined: Thu Feb 12, 2026 12:58 pm

HTTP 4xx handling in WebView

Post by willy_mwangi »

We have a plugin that runs a webview and then loads a web-app (sidebar) inside it. We noticed that when we have responses of 200, everything works fine but when we get 400 errors, our web-app doesn’t work properly. When we enable debugging, we can see the error attached. However, our web-app is unable to process the error. We tried reproducing the issue with a standalone JFX and Swing application but everything worked fine.

The 400 error has more information in the body and it seems this information is lost and hence the reason why our web-app doesn't seem to work as expected. The error has a json payload that has error detail, type, and title along with status.

Which leaves us with the question, why does this happen in Oxygen only and not in the browser or other applications that run the web-app?

We used Oxygen Editor version 25, 26, 27, and 28 for testing.

Code: Select all

ro.sync.net.protocol.http.HttpExceptionWithDetails: 400 Bad Request for: https://our-service.com/api/v1/check
	at ro.sync.net.protocol.http.b.s.x(Unknown Source)
	at ro.sync.net.protocol.http.b.s.c(Unknown Source)
	at ro.sync.net.protocol.http.abstraction.n.r(Unknown Source)
	at ro.sync.net.protocol.http.abstraction.n.e(Unknown Source)
	at ro.sync.net.protocol.http.WebdavHttpURLConnection$_c.close(Unknown Source)
	at com.sun.webkit.network.URLLoader.sendRequest(URLLoader.java:373)
	at com.sun.webkit.network.URLLoader.doRun(URLLoader.java:163)
	at com.sun.webkit.network.URLLoader.lambda$run$0(URLLoader.java:130)
Radu
Posts: 9649
Joined: Fri Jul 09, 2004 5:18 pm

Re: HTTP 4xx handling in WebView

Post by Radu »

Hi,

Oxygen has its own HTTP client libraries inside and it overrides the HTTP protocol completely in the entire application to use its own HTTP URL handler instead of the HTTP URL handler provided by the default Java libraries.
So Oxygen's own HTTP URL handler may and does behave differently from the default Java libraries HTTP URL handler implementation.
We have this custom plugin extension which allows a plugin to decide that for a certain URL host to delegate to the Java base URL handler instead of using our own:
https://www.oxygenxml.com/doc/versions/ ... lugin.html

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply