Announcement Announcement Module
Collapse
No announcement yet.
Spring validator without error message Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring validator without error message

    Hi,

    I have Spring model validator which validates my post data and if validation passes goes to controller.

    If any issue on form data, validation fails by just adding the errorMessage in messagecontext.

    Is there any way that I can make validation fails without adding errorMessage. Because I need to show custom warning message in specific position of page.
    But as am using <form:error path="*"> all the error messages are showing at single place.

    I need to make the validation failed without adding error message, show that I can show my custom message.

    Sample code:

    Code:
    Class Myvalidator{
    
    public void myFormValidator(model, validationContext){
    
    if (issue in form data)
    validationContext.getMessageContext().addMessage();
    
    }
    }
    Thanks in Advance !!!
Working...
X