How to give default value as integer in @RequestParam()

Try with “” around integer to make it string as the defaultValue is implemented as String.

@RequestMapping("/returnVeriable")
public int getVeriable(@RequestParam(required=true,defaultValue="1") Integer veri){
    return veri;
}

refer : https://jira.spring.io/browse/SPR-5915

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)