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

Method main6

ch2/RequestParamTest.java:59–65  ·  view source on GitHub ↗
(int year)

Source from the content-addressed store, hash-verified

57// =======================================================================
58
59 @RequestMapping("/requestParam6")
60 public String main6(int year) {
61// http://localhost/ch2/requestParam6 ---->> 500 java.lang.IllegalStateException: Optional int parameter 'year' is present but cannot be translated into a null value due to being declared as a primitive type. Consider declaring it as object wrapper for the corresponding primitive type.
62// http://localhost/ch2/requestParam6?year ---->> 400 Bad Request, nested exception is java.lang.NumberFormatException: For input string: ""
63 System.out.printf("[%s]year=[%s]%n", new Date(), year);
64 return "yoil";
65 }
66
67 @RequestMapping("/requestParam7")
68 public String main7(@RequestParam int year) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected