I am trying to output an html file that used to be a .txt file. I had to format the .txt file into html using regex. I tried doing what user Krige did on here: Write HTML file using Java I'm still a beginner, how do I write the newly made .html file to the $body - and then display it?
File htmlTemplateFile = new File("path/template.html");
String htmlString = FileUtils.readFileToString(htmlTemplateFile);
String title = "New Page";
String file = "Shakespeare.html"
htmlString = htmlString.replace("$body", file);
File newHtmlFile = new File("path/new.html");
FileUtils.writeStringToFile(newHtmlFile, htmlString);