MCPcopy Create free account
hub / github.com/castello/spring_basic / main9

Method main9

ch2/RequestParamTest.java:83–89  ·  view source on GitHub ↗
(@RequestParam(required=true) int year)

Source from the content-addressed store, hash-verified

81 }
82
83 @RequestMapping("/requestParam9")
84 public String main9(@RequestParam(required=true) int year) {
85 // http://localhost/ch2/requestParam9 ---->> 400 Bad Request, Required int parameter 'year' is not present
86 // http://localhost/ch2/requestParam9?year ---->> 400 Bad Request, nested exception is java.lang.NumberFormatException: For input string: ""
87 System.out.printf("[%s]year=[%s]%n", new Date(), year);
88 return "yoil";
89 }
90
91 @RequestMapping("/requestParam10")
92 public String main10(@RequestParam(required=true, defaultValue="1") int year) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected