I define a path variable at controller Get request using:
@PathVariable("ticketId") final Long ticketId
How can I check this value is not null ?
Reading https://www.baeldung.com/spring-validate-requestparam-pathvariable @NotBlank is utilised but checking for null is not mentioned.
Using:
if ticketId == Null {
//return message indicating to user that null has been passed to path
}
Seems a bad practice and instead try/catch should be used ?