Shiv Kumar Ganesh
Shiv Kumar Ganesh

Reputation: 3825

How to dynamically generate Validations for the Front end depending upon the Logic

Consider the page below. As in the image I have attached. enter image description here

Now my problem is that I have multiple clients accessing the same page as given below. Now consider that each client has their own requirement such as:-

  1. Name is mandatory for some clients not for others.
  2. Age is mandatory for some clients but not for others along with some specific validations like age<20 or age>30 etc.
  3. Search is also optional depending upon the clients.

Now I am searching for any such tools or technologies or methods that could help me to sort out the issue of dynamically validating the fields as well as hiding and showing the fields depending upon my clients. Please let me know any tools or technologies that can help in order to solve the above problem. I also heard about rule engine and templating .... Is it possible to work together with it to achieve the same. Please suggest.

Upvotes: 1

Views: 172

Answers (1)

Eugene
Eugene

Reputation: 120968

I have no idea why hibernate-validator would not work here. You implement the validation as you want, by implementing an interface and creating your own validation annotations if needed. This is a server-side validation btw.

Showing or not some content in case of JSP is done with conditional :

c:when/c:choose 

for example, assuming it's JSP you are using.

Upvotes: 1

Related Questions