JSF : Better way to check for existence of

后端 未结 3 1331
眼角桃花
眼角桃花 2021-02-02 11:26

I have a form in which validation error message needs to be displayed below the input elements. The error needs to be highlighted by showing an error bubble around the error mes

3条回答
  •  有刺的猬
    2021-02-02 12:10

    Iterator pkit = fctxt.getMessages(); // check all existing messages from the FacesContext         
    while(pkit.hasNext()){ 
        System.out.println(pkit.next().getDetail()); // get message text
        System.out.println(pkit.next().getSummary());
    }
    

    If the message you are looking for is found in the while loop, you can take appropriate action

提交回复
热议问题