package driver; import java.util.ArrayList; import static spark.Spark.*; public class Driver { private ArrayList messages = new ArrayList(); public static void main(String[] args) { new Driver().start(); } void start() { get("/", (req, res) -> { String messagesString = ""; messagesString += ""; return "" + "

Twetter

" + messagesString + "

" + "

" + "" + "" + "
" + "

" + ""; }); post("/postmessage", (req, res) -> { System.out.println("Recieved message : " + req.queryParams("message")); messages.add(req.queryParams("message").replace("<", "")); res.redirect("/"); return res; }); } }