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

@@ -22,6 +22,4 @@ Download all license here: https://open-autonomous-connection.org/assets/license
# In progress
# TODO
everything
# TODO

View File

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