HTTP Injection Server Side is the future of Java web devlopment with the ability to create and render modules directly into HTML.
Common Lang -> StringUtils - https://commons.apache.org/proper/commons-lang/download_lang.cgi
Me. (To be honest, it took me forever to figure out some of the logic for the Strings lmao cause I had to replace in an already created string.)
Begin by simply dragging the .jar file into the classpath of your Eclipse Project. To create the HISS object follow the code below.
HISS h = new HISS();
Component createComponent(String html, String name) // RETURNS A COMPONENT WITH THE SPECIFIED HTML AND NAME.
void setClosing(boolean closing) // SETS THE TAG FOR THE MODULES TO </tagname> rather than <tagname>.
void addDefaultComponents() // ADDS THE DEFAULT BUILT-IN COMPONENTS OF <jquery> and <winbox> javascript.
String renderHTML(String html) // RENDERS AND RETURN THE HTML WITH COMPONENTS.
Component getComponentWithName(String name) // RETURNS THE COMPONENT FROM CREATED COMPONENTS WITH THE SPECIFIED NAME.
List<Component> getComponents() // RETURNS THE CURRENT COMPONENTS LIST.
void setComponentHtml(String name, String html) // ALLOWS YOU TO CHANGE THE HTML OF A REGISTERED COMPONENT.
Please be aware that this example is using my JavaHTTPServer API.
public static void main(String[] args) throws IOException {
WebserverMain ws = new WebserverMain(9000);
HISS h = new HISS();
h.setClosing(true);
h.addDefaultComponents();
h.createComponent("<iframe width=\"" + 560*4 + "\" height=\"" + 315*4 + "\" src=\"https://www.youtube-nocookie.com/embed/hzJVP5b61IA\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>", "biggiecheese"); // CREATES A YOUTUBE COMPONENT WITH BIGGIE CHEESE.
public static void main(String[] args) throws IOException {
}
@Override
public void handle(HttpExchange he) throws IOException {
WebserverMain ws = Main.ws;
ws.sendResponse(he, Main.h.renderHTML("<html> <head> </head> <body> </jquery></biggiecheese> </body> </html>"));
}