import model.Status;
import model.TodoDao;
import spark.*;
import spark.template.velocity.*;
import java.util.*;
import static spark.Spark.*;

public class Ubay {

    public static void main(String [] args) {

        exception(Exception.class, (e, req, res) -> e.printStackTrace()); // print all exceptions
        staticFiles.location("/public");
        port(9999);

        // Render main UI
        get("/", (req, res) -> renderGUI(req));
        get("/login", (req, res) -> renderLoginTemplate(req));
        put("/login2", (req, res) -> parseLogin(req)); }


    private static String parseLogin(Request req) {

        String email = req.queryParams("email");
        String password = req.queryParams("password");

        System.out.println(email);
        System.out.print(password);

    return renderTemplate("velocity/home.vm", new HashMap()); }

    private static String renderGUI(Request req) {
        String statusStr = req.queryParams("status");
        Map<String, Object> model = new HashMap<>();
        if ("true".equals(req.queryParams("ic-request"))) {
            return renderTemplate("velocity/todoList.vm", model);
        }
        return renderTemplate("velocity/index.vm", model);
    }

    private static String renderLoginTemplate(Request req) {
        Map<String, Object> model = new HashMap<>();
        return renderTemplate("velocity/login.vm", model);
    }

    private static String renderTemplate(String template, Map model) {
        return new VelocityTemplateEngine().render(new ModelAndView(model, template));
    }

}
@@ -140,74 +140,880 @@
 *;%0A%0A
-public class Ubay %7B%0A%0A    public static void main(String %5B%5D args) %7B
+%0A/*%0A        //Connect to DB%0A        Connection con = DriverManager.getConnection(%22jdbc:mysql://localhost:3306/uBay%22, %22root%22, %221234%22);%0A%0A        //Execute Query%0A        Statement stmt = con.createStatement();%0A        ResultSet rs = stmt.executeQuery(%22SELECT first_name, last_name FROM account%22);%0A%0A        //Get Query Results%0A        while (rs.next()) %7B%0A            //Retrieve by column name%0A            String FN = rs.getString(%22first_name%22);%0A            String LN = rs.getString(%22last_name%22);%0A%0A            //Display values%0A            System.out.println(%22, First: %22 + FN);%0A            System.out.println(%22, Last: %22 + LN);%0A            System.out.println();%0A */%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0Apublic class Ubay %7B%0A%0A    public static void main(String %5B%5D args) %7B%0A%0A        //Connect to DB%0A        Connection con = DriverManager.getConnection(%22jdbc:mysql://localhost:3306/uBay%22, %22root%22, %221234%22);
 %0A%0A  

Set up connection to DB