java - Is it possible to have empty RequestParam values use the defaultValue? - Stack Overflow
You can keep primitive type by setting default value, in the your case just add "required = false" property:
@RequestParam(value = "i", required = false, defaultValue = "10") int i
Read full article from java - Is it possible to have empty RequestParam values use the defaultValue? - Stack Overflow
No comments:
Post a Comment