@NotNull爆红
时间: 2023-09-26 18:11:56 浏览: 116
@NotNull爆红通常是因为在使用@NotNull注解修饰的参数或字段上传入了null值,导致空指针异常。@NotNull注解的作用是在参数中使用时,如果传入了null值,就会抛出空指针异常。所以当你在代码中使用@NotNull注解修饰的参数或字段时,如果传入的值可能为空,就会出现@NotNull爆红的情况。为了解决这个问题,你可以确保传入的值不为空,或者使用其他合适的注解来替代@NotNull注解,例如@NotBlank或@NotEmpty,根据具体的需求来选择合适的注解。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [spring 注解验证@NotNull等使用方法](https://download.csdn.net/download/weixin_38725450/12725076)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [idea lombok简介及报红、报错解决办法](https://blog.csdn.net/daisy_zhangy/article/details/89873972)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [Java和springmvc@NotNull报错,校验不生效!](https://blog.csdn.net/Mrs_chens/article/details/102664415)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文