在 Primefaces 中显示异常消息
我有这个添加新客户的方法,所以当我输入已经存在的昵称时会引发异常,我如何在添加表单中显示异常消息,我使用 primefaces
public String addCustomer() {
webClient
.post()
.uri("/customer/addCustomer")
.bodyValue(customer)
.retrieve()
.onStatus(HttpStatus.BAD_REQUEST::equals,
response -> Mono.error(new NickNameExistException("NickName Exist. Please Try another one.")))
.bodyToMono(Customer.class);
I have this Method that adds a new customer, So when i put a nickname that already exists an exception is thrown, how can i show the message of the exception in the adding form, iam using primefaces
public String addCustomer() {
webClient
.post()
.uri("/customer/addCustomer")
.bodyValue(customer)
.retrieve()
.onStatus(HttpStatus.BAD_REQUEST::equals,
response -> Mono.error(new NickNameExistException("NickName Exist. Please Try another one.")))
.bodyToMono(Customer.class);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您可以在这样的对话框中显示消息(有关更多详细信息,请参阅此
I think that you can show the message in a dialog like that (for more details see this answer)