Commit 159273eb authored by sp2419's avatar sp2419
Browse files

CHANGE writing of indexPage

parent c7888c41
Pipeline #173699 passed with stages
in 5 minutes and 12 seconds
......@@ -19,46 +19,78 @@ public class IndexPage implements Page {
public void writeContent(Writer _writer) throws IOException {
PrintWriter writer = (PrintWriter) _writer;
File indexPage = new File("src/main/java/ic/doc/web/indexPage.html");
Scanner indexPageScanner = new Scanner(indexPage);
// File indexPage = new File("src/main/java/ic/doc/web/indexPage.html");
// Scanner indexPageScanner = new Scanner(indexPage);
//
// StringBuilder indexPageContentsBuilder = new StringBuilder();
//
// while (indexPageScanner.hasNextLine()) {
// indexPageContentsBuilder.append(indexPageScanner.nextLine());
// }
//
// indexPageScanner.close();
//
// String indexPageContents = indexPageContentsBuilder.toString();
//
// writer.println(indexPageContents);
StringBuilder indexPageContentsBuilder = new StringBuilder();
writer.println("<html>\n" +
"<head><title>Welcome</title></head>\n" +
"\n" +
"<body style=\"\n" +
"text-align:center;\n" +
"color:black;\n" +
"background: linear-gradient(to bottom, tan 0%, darkturquoise 200%);\n" +
"background: #ecc19c;\n" +
"font-family:arial;\n" +
"\">\n" +
"<br>\n" +
"<h1 style=\"color:#1e847f\"><u>Welcome To The Mystery Query!!</u></h1><br><br>\n" +
"<p style=\"color:black\">Enter your query in the box below:\n" +
" <form>\n" +
" <input type=\"text\" name=\"q\"/\n" +
" style=\"color:white;\n" +
" font-size:30;text-align:center;\n" +
" background-color: #1e847f;border:0px\">\n" +
" <br><br><input type=\"submit\">\n" +
" <br><br>\n" +
" <p>Result format:</p>\n" +
" <input type=\"radio\" name=\"format\" id=\"http\" value=\"http\" checked>\n" +
" <label for=\"http\" style=\"color:black\">HTTP</label>\n" +
" <input type=\"radio\" name=\"format\" id=\"markdown\" value=\"markdown\">\n" +
" <label for=\"markdown\" style=\"color:black\">Markdown</label>\n" +
" <input type=\"radio\" name=\"format\" id=\"pdf\" value=\"pdf\">\n" +
" <label for=\"pdf\" style=\"color:black\">PDF</label>\n" +
" </form>\n" +
"</p>\n" +
"</body>\n" +
"</html>");
while (indexPageScanner.hasNextLine()) {
indexPageContentsBuilder.append(indexPageScanner.nextLine());
}
indexPageScanner.close();
String indexPageContents = indexPageContentsBuilder.toString();
writer.println(indexPageContents);
// // Header
// writer.println("<html>");
// writer.println("<head><title>Welcome</title></head>");
// writer.println("<body>");
//
// // Content
// writer.println(
// "<h1>Welcome To The Mystery Query!!</h1>" +
// "<p>Enter your query in the box below: " +
// "<form>" +
// "<input type=\"text\" name=\"q\" />" +
// "<br><br><input type=\"submit\">" +
// "<br><br><p>Result format:</p>" +
// "<input type=\"radio\" name=\"format\" id=\"http\" value=\"http\" checked>" +
// "<label for=\"http\">HTTP</label>" +
// "<br><input type=\"radio\" name=\"format\" id=\"markdown\"
// value=\"markdown\">" +
// "<label for=\"markdown\">Markdown</label>" +
// "<br><input type=\"radio\" name=\"format\" id=\"pdf\" value=\"pdf\">" +
// "<label for=\"pdf\">PDF</label>" +
// "</form>" +
// "</p>");
//
// // Footer
// writer.println("</body>");
// writer.println("</html>");
// // Header
// writer.println("<html>");
// writer.println("<head><title>Welcome</title></head>");
// writer.println("<body>");
//
// // Content
// writer.println(
// "<h1>Welcome To The Mystery Query!!</h1>" +
// "<p>Enter your query in the box below: " +
// "<form>" +
// "<input type=\"text\" name=\"q\" />" +
// "<br><br><input type=\"submit\">" +
// "<br><br><p>Result format:</p>" +
// "<input type=\"radio\" name=\"format\" id=\"http\" value=\"http\" checked>" +
// "<label for=\"http\">HTTP</label>" +
// "<br><input type=\"radio\" name=\"format\" id=\"markdown\"
// value=\"markdown\">" +
// "<label for=\"markdown\">Markdown</label>" +
// "<br><input type=\"radio\" name=\"format\" id=\"pdf\" value=\"pdf\">" +
// "<label for=\"pdf\">PDF</label>" +
// "</form>" +
// "</p>");
//
// // Footer
// writer.println("</body>");
// writer.println("</html>");
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment