Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Tinglyyy
2026-03-02 17:42:05 +01:00
2 changed files with 11 additions and 11 deletions

View File

@@ -23,5 +23,3 @@ Download all license here: https://open-autonomous-connection.org/assets/license
# In progress # In progress
# TODO # TODO
everything

View File

@@ -1,6 +1,7 @@
package org.openautonomousconnection.webserver.api; package org.openautonomousconnection.webserver.api;
import org.openautonomousconnection.protocol.packets.v1_0_1.beta.web.impl.resource.WebResourceResponsePacket; import org.openautonomousconnection.protocol.packets.v1_0_1.beta.web.impl.resource.WebResourceResponsePacket;
import org.openautonomousconnection.webserver.Main;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import org.w3c.dom.Element; import org.w3c.dom.Element;
import org.w3c.dom.html.HTMLBodyElement; import org.w3c.dom.html.HTMLBodyElement;
@@ -23,26 +24,27 @@ public abstract class WebPage {
private static final DocumentBuilder documentBuilder; private static final DocumentBuilder documentBuilder;
static { static {
DocumentBuilder temp = null;
try { try {
documentBuilder = factory.newDocumentBuilder(); temp = factory.newDocumentBuilder();
} catch (ParserConfigurationException e) { } catch (ParserConfigurationException e) {
throw new RuntimeException(e); Main.getValues().logger.exception("Failed to create document builder", e);
} temp = null;
} }
protected Document document; documentBuilder = temp;
}
protected HTMLBodyElement body; protected final Document document;
protected final HTMLHeadElement head;
protected final HTMLBodyElement body;
protected HTMLHeadElement head;
/** /**
* Default constructor that creates a new Document instance * Default constructor that creates a new Document instance
*/ */
public WebPage() { public WebPage() {
this.document = documentBuilder.newDocument(); this.document = documentBuilder.newDocument();
this.head = (HTMLHeadElement) this.document.createElement("head"); this.head = (HTMLHeadElement) this.document.createElement("head");
this.body = (HTMLBodyElement) this.document.createElement("body"); this.body = (HTMLBodyElement) this.document.createElement("body");
this.document.appendChild(this.head); this.document.appendChild(this.head);