forked from NeilAlishev/SpringCourse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFirstController.java
More file actions
28 lines (22 loc) · 797 Bytes
/
FirstController.java
File metadata and controls
28 lines (22 loc) · 797 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package ru.alishev.springcourse.controllers;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* @author Neil Alishev
*/
@Controller
@RequestMapping("/first")
public class FirstController {
@GetMapping("/hello")
public String helloPage(@RequestParam(value = "name", required = false) String name,
@RequestParam(value = "surname", required = false) String surname) {
System.out.println("Hello, " + name + " " + surname);
return "first/hello";
}
@GetMapping("/goodbye")
public String goodByePage() {
return "first/goodbye";
}
}