Skip to content

Commit 4e8e82d

Browse files
June LeeJune Lee
authored andcommitted
created a form without Post Handler
1 parent 95e8dcd commit 4e8e82d

2 files changed

Lines changed: 23 additions & 1 deletion

File tree

thymeleafViews/codingevents/src/main/java/org/launchcode/codingevents/controllers/EventController.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,8 @@ public String eventHandler(Model model) {
2424
return "events/index";
2525
}
2626

27-
27+
@GetMapping("create") //events/create
28+
public String renderCreateEventForm() {
29+
return "events/create";
30+
}
2831
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!DOCTYPE html>
2+
<html lang="en" xmlns:th="https://www.thymeleaf.org/">
3+
<head>
4+
<meta charset="UTF-8"/>
5+
<title>Create Event</title>
6+
</head>
7+
<body>
8+
<div>
9+
<h1>Create Event</h1>
10+
</div>
11+
12+
<div>
13+
<form method ="post" action="/events/create">
14+
<input type="text" name="eventName">
15+
<input type="submit" value="Create Event">
16+
</form>
17+
</div>
18+
</body>
19+
</html>

0 commit comments

Comments
 (0)