[bv-dev] Javascript export of bean validation rules

Edward Burns edward.burns at oracle.com
Thu Jun 28 12:07:48 EDT 2012


>>>MI> On Thu, 28 Jun 2012 10:15:14 +0200, Hardy Ferentschik <hardy at hibernate.org> said:

HF> On Jun 28, 2012, at 6:59 AM, Michael Isvy wrote:

MI> I was discussing this topic with Emmanuel Bernard by email and
MI> Emmanuel suggested that we move this conversation to this
MI> mailing-list, so here I am :).

MI> The idea would be to propose a javascript export of the bean
MI> validation rules.

HF> What exactly do you want to export? An JavaScript implementation of
HF> the default constraints? Do you have already some concrete ideas?

When I saw this idea right here, moments ago, my first thought was to
specify a JSON format for validation rules and require the existence of
some tool that you could point at a bunch of java code that happens to
have JSR-303 annotations on it and the tool would generate that JSON.
The JSON format would be designed such that the fidelity of the rules
would be mostly maintained such that a corresponding piece of code on
the client side could slurp it down and carry out the rules.

MI> Many web technologies such as JSF, Spring MVC, Wicket,
MI> Tapestry... integrate with JSR 303. Providing such export would be
MI> of great help for users of those frameworks (or standard in the case
MI> of JSF).

Speaking for JSF, this would be a side-benefit rather than something
we'd bake in directly, though it does open the door for standardizing
client side validation in the future.

Ed

-- 
| edward.burns at oracle.com | office: +1 407 458 0017
| homepage:               | http://ridingthecrest.com/
| 15 Business days til JSF 2.2 Public Review to EG


More information about the beanvalidation-dev mailing list