allCards = (new SQLDriver()).getAllCards();
model.addAttribute("allcards", allCards);
-
return "card";
}
-
-
-
- @PostMapping({"/card"})
- public String greet(@RequestParam("cardname") String cardname, @RequestParam("manacost") int manacost,
- @RequestParam("power") int power, @RequestParam("toughness") int toughness, @RequestParam("description") String description, @RequestParam("creaturetype") String creaturetype,
- @RequestParam("username") String username, @RequestParam("password") String password, ModelMap modelMap) {
+
+ @PostMapping({"/card", "/"})
+ public String newCard(@RequestParam("cardname") String cardname, @RequestParam("manacost") int manacost,
+ @RequestParam("power") int power, @RequestParam("toughness") int toughness, @RequestParam("description") String description,
+ @RequestParam("creaturetype") String creaturetype, ModelMap modelMap) {
SQLDriver d = new SQLDriver();
- if (d.authenticateUser(username, password)) {
- Card newCard = new Card(cardname, manacost, power, toughness, description, "", creaturetype);
- d.insertCard(newCard);
- }
+ System.out.println(creaturetype);
+ System.out.println("Posting to /card detected");
+ Card newCard = new Card(cardname, manacost, power, toughness, description, "", creaturetype);
+ d.insertCard(newCard);
+ //modelMap.addAttribute("allcards", d.getAllCards());
return "card";
}
diff --git a/src/main/webapp/WEB-INF/jsp/card.jsp b/src/main/webapp/WEB-INF/jsp/card.jsp
index 99fa0e0..a7c6679 100644
--- a/src/main/webapp/WEB-INF/jsp/card.jsp
+++ b/src/main/webapp/WEB-INF/jsp/card.jsp
@@ -1,6 +1,6 @@
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
-
+
@@ -38,7 +38,7 @@ table, td, th{
-