Made a card homepage.
This commit is contained in:
@ -13,7 +13,7 @@ import java.util.ArrayList;
|
|||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
public class CardController {
|
public class CardController {
|
||||||
@GetMapping({"/card"})
|
@GetMapping({"/card", "/"})
|
||||||
public String hello(Model model) {
|
public String hello(Model model) {
|
||||||
ArrayList<Card> allCards = (new SQLDriver()).getAllCards();
|
ArrayList<Card> allCards = (new SQLDriver()).getAllCards();
|
||||||
model.addAttribute("allcards", allCards);
|
model.addAttribute("allcards", allCards);
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
public class HelloController {
|
public class HelloController {
|
||||||
@GetMapping({"/", "/hello"})
|
@GetMapping({"/hello"})
|
||||||
public String hello(Model model, @RequestParam(value="name", required=false, defaultValue="World") String name) {
|
public String hello(Model model, @RequestParam(value="name", required=false, defaultValue="World") String name) {
|
||||||
model.addAttribute("name", name);
|
model.addAttribute("name", name);
|
||||||
return "hello";
|
return "hello";
|
||||||
|
|||||||
Reference in New Issue
Block a user