Commit 9fc9d832 by Patryk Czarnik

kilka metod

parent 5cd10170
......@@ -4,13 +4,24 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
/* Controller to jest klasa, która decyduje o tym, co ma się stać,
* gdy na serwer przyjdzie zapytanie kierowane pod określone adres.
* W projekcie może być wiele kontrolerów, a w klasie kontrolera może być wiele metod.
*/
@Controller
public class HelloController {
@RequestMapping
@RequestMapping("/hello")
@ResponseBody
public String hello() {
return "Hello world";
}
@RequestMapping("/ahoj")
@ResponseBody
public String ahoj() {
return "Ahoj świecie!";
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment