(@RequestParam(required=false) int year)
| 73 | } |
| 74 | |
| 75 | @RequestMapping("/requestParam8") |
| 76 | public String main8(@RequestParam(required=false) int year) { |
| 77 | // http://localhost/ch2/requestParam8 ---->> 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. |
| 78 | // http://localhost/ch2/requestParam8?year ---->> 400 Bad Request, nested exception is java.lang.NumberFormatException: For input string: "" |
| 79 | System.out.printf("[%s]year=[%s]%n", new Date(), year); |
| 80 | return "yoil"; |
| 81 | } |
| 82 | |
| 83 | @RequestMapping("/requestParam9") |
| 84 | public String main9(@RequestParam(required=true) int year) { |
nothing calls this directly
no outgoing calls
no test coverage detected