I am not able to catch the exception when I send the below request. empno datatype is long. But am sending more than max of long value. Even I tried @Min
and @Max
annotation in my pojo class but it's not working. As per my requirement I should not use string instead of long.
{
"empno": 135458464765456464654564654566
}
public class Personal
{
private long empNo;
public void setEmpNo(long empNo)
{
this.empNo = empNo;
}
public long getEmpNo()
{
return this.empNo;
}
}
@RestController
@RequestMapping(value = "/employee/v1")
public class EmployeeController {
public ResponseEntity<LocationResponse> getLocationService(HttpServletRequest httpServletRequest,
@Valid @RequestBody Personal personal, HttpServletResponse httpResponse)
{
.... Business Logic
}
}