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

Method main10

ch2/RequestParamTest.java:91–97  ·  view source on GitHub ↗
(@RequestParam(required=true, defaultValue="1") int year)

Source from the content-addressed store, hash-verified

89 }
90
91 @RequestMapping("/requestParam10")
92 public String main10(@RequestParam(required=true, defaultValue="1") int year) {
93 // http://localhost/ch2/requestParam10 ---->> year=1
94 // http://localhost/ch2/requestParam10?year ---->> 400 Bad Request, nested exception is java.lang.NumberFormatException: For input string: ""
95 System.out.printf("[%s]year=[%s]%n", new Date(), year);
96 return "yoil";
97 }
98
99 @RequestMapping("/requestParam11")
100 public String main11(@RequestParam(required=false, defaultValue="1") int year) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected