Bean Validation

460 views
Skip to first unread message

ManfredTremmel

unread,
Jul 2, 2016, 5:40:56 PM7/2/16
to GWT Contributors
I've read in the 2.8rc1 release notes that JSR 303 Bean Validation in GWT is unmaintaned and marked as deprecated. For me, the client and server side validation is a killer feature and I've already solve the problems I had and also improved the client side bean validation in my gwt-bean-validators project on github. In three weeks I can invest some time in working into the gwt implementation of bean validation and try to port it to 1.1 api. If you are interested I would also include the improvements of my project into GWT.
Let me know if you are interested in my help or have any question.

Thomas Broyer

unread,
Jul 2, 2016, 6:34:32 PM7/2/16
to GWT Contributors

On Saturday, July 2, 2016 at 11:40:56 PM UTC+2, ManfredTremmel wrote:
I've read in the 2.8rc1 release notes that JSR 303 Bean Validation in GWT is unmaintaned and marked as deprecated. For me, the client and server side validation is a killer feature and I've already solve the problems I had and also improved the client side bean validation in my gwt-bean-validators project on github. In three weeks I can invest some time in working into the gwt implementation of bean validation and try to port it to 1.1 api. If you are interested I would also include the improvements of my project into GWT.
Let me know if you are interested in my help or have any question.

We decided (a long time ago) that we wanted to modularize GWT, and move to side-projects what could be decoupled. The goal is to spread maintenance to more people (hopefully) by reducing the scope of each project, and allowing those side-projects to have different release cycles than GWT. This means that GWT does not need to wait for some bugs to be fixed or features to be added to some parts of the code before a release can be cut, concentrating on the compiler and core (emulation, etc.), and projects can release without waiting for a GWT release either.

So, if you can contribute some time, it'd be great to be able to move Bean Validation to its own project and out of GWT proper (there'd still be some javax.validation emulation in GWT proper, at least some interfaces; but there may be some work needed to make other GWT features independent of the Bean Validation version being used; I think there's some code in Editors or Request Factory that implements a javax.validation interface). Then the project can live its own life and update to a newer Hibernate Validator, etc.
FWIW, JBoss has interest in Bean Validation too, so you may want to get in touch with Christian Sadilek.
FWIW, Putnami PWT also has some form of JSR 303 support, so I suppose they'd be interested in, at least, following the changes made to GWT on the subject.

In any case, all help is welcome. So, welcome, and thank you in advance for your contributions !

Thomas Broyer

unread,
Jul 4, 2016, 8:56:08 AM7/4/16
to GWT Contributors
FWIW, I've spent some time yesterday (and polished today) to remove Bean Validation from GWT proper: https://gwt-review.googlesource.com/15371
This is obviously not expected to be merged anytime soon but can be useful to start moving things to a separate project; testing it against a GWT version that would already have it removed.
As soon as such a project exists, and depending on GWT's release cycle/status, this can be merged in so the side project could be used against GWT snapshots (pending the next release).

ManfredTremmel

unread,
Jul 4, 2016, 3:04:06 PM7/4/16
to GWT Contributors
Thank you for the information. This means, it makes no sense to send any validation patch to gwt and better include it directly into the external project.
I thought, removal would not be done before gwt 3.0...

Jens

unread,
Jul 4, 2016, 3:19:47 PM7/4/16
to GWT Contributors
I thought, removal would not be done before gwt 3.0...

Thats right. Validation will still be present in 2.8, its just marked deprecated. The change Thomas has made won't be committed before 2.8, but you can use it to determine what needs to be extracted into your external project. You can then also use it to build a custom GWT without validation and use it together with your external project to see if things work as expected.

-- J.

ManfredTremmel

unread,
Aug 4, 2016, 10:11:57 AM8/4/16
to GWT Contributors

For your information, I've just commited a new gwt-bean-validators snapshot, it now:

  • includes complete validation implementation (ported from gwt implementation, so if it'll be removed from gwt it should still work)
  • switched validation-api from 1.0.0.GA to 1.1.0.Final
  • switched hibernate-validator from 4.1.0.Final to 5.2.4.Final
  • reworked validation implementation to work together with new api
  • added some gwt implementations of incompatible hibernate-validator 5.2.4 validation routines
It's not ready to release, but if anybody is interested in testing, it can be done now. I've also uploaded to maven repository:


What to do to let a project use it?


  1. Add the maven dependency:
    <dependency>
       
    <groupId>de.knightsoft-net</groupId>
       
    <artifactId>gwt-bean-validators</artifactId>
       
    <version>0.19.0-SNAPSHOT</version>
    </dependency>

  2. Add/Replace versions in maven configurations of validation-api to 1.1.0.Final and hibernate-validator to 5.2.4.Final
  3. In the *.gwt.xml Configuration, replace
    <inherits name="org.hibernate.validator.HibernateValidator" />

    with
    <inherits name="de.knightsoftnet.validators.GwtBeanValidators" />

  4. Replace "com.google.gwt.validation" with "de.knightsoftnet.validators" in the project

I've build with gwt 2.7.0, also tested with 2.8.0-rc1 and all my 235 gwt-unit-tests have passed.

Colin Alworth

unread,
Aug 4, 2016, 10:19:50 AM8/4/16
to GWT Contributors
What maven repo has the SNAPSHOT in it? 

Is https://github.com/ManfredTremmel/gwt-bean-validators the source for this? Great work, looking forward to putting this to use, and porting it to annotation processors for long-term GWT support!

I'm working with Frank Hossfeld on porting Editors to APT as well, perhaps we can work together to provide the extra functionality you require to be exposed from drivers. 

--
You received this message because you are subscribed to the Google Groups "GWT Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit-contributors/ffe8a4b9-fb83-4f38-94d5-2fcb63b026e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thomas Broyer

unread,
Aug 4, 2016, 11:06:58 AM8/4/16
to GWT Contributors


On Thursday, August 4, 2016 at 4:19:50 PM UTC+2, Colin Alworth wrote:
What maven repo has the SNAPSHOT in it? 

Manfred Tremmel

unread,
Aug 4, 2016, 11:35:11 AM8/4/16
to google-web-tool...@googlegroups.com
Am Donnerstag, 4. August 2016, 14:19:31 schrieb Colin Alworth:

> What maven repo has the SNAPSHOT in it?

It's in Sonatype Nexus Snapshots:
https://oss.sonatype.org/content/repositories/snapshots/de/knightsoft-net/gwt-bean-validators/0.19.0-SNAPSHOT/

should be available in central without adding something special in the pom.xml.
Yes.

Including bean validation routine from gwt project:
https://github.com/ManfredTremmel/gwt-bean-validators/commit/c0bf4e57ea9200e41c23f1351636d92243c2c609
https://github.com/ManfredTremmel/gwt-bean-validators/commit/8d10e62ff666a499490a40b50bf8909ed01dafcb

Migration of the api (yes, It was a real big commit):
https://github.com/ManfredTremmel/gwt-bean-validators/commit/4600230efb15f176f91b15d06d0ffa39bfda1feb


> Great work, looking forward to putting this to use, and
> porting it to annotation processors for long-term GWT support!

If interested, I can backport it to the GWT project for 2.8.1 or so.
This was the Idea why I've started this thread a month ago.
As I understood Thomas Broyer, there was no interest to update validation
in gwt, as it should be removed in future versions

> I'm working with Frank Hossfeld on porting Editors to APT as well,
> perhaps we can work together to provide the extra functionality you
> require to be exposed from drivers.

I'm glad with Editor functionality. I've created my own driver
(BeanValidationEditorDriver) to automate validation, as you
can read on the wiki page (Topic "Client side validation") on
https://github.com/ManfredTremmel/gwt-bean-validators-example/wiki/Client-Implementation
and test on https://www.knightsoft-net.de/validationexample/
If you are interested in adding some of the functionality, I'm glad to
help you

--
Machs gut | http://www.iivs.de/schwinde/buerger/tremmel/
| https://github.com/ManfredTremmel
Manfred | http://www.knightsoft-net.de

ManfredTremmel

unread,
Aug 14, 2016, 6:29:48 PM8/14/16
to GWT Contributors
My vacation is over, three weeks of work on the gwt validation implementation are done. All problems I've found are fixed, gwt-bean-validators 0.20.0 is released and in central. The example project is also uploaded and online in the new version.
Enjoy bean validation with validation-api 1.1.0.Final, hibernate-validator 5.2.4.Final and let me know, if you are interested in backporting it to gwt project.

Freddy Boucher

unread,
Aug 14, 2016, 10:09:22 PM8/14/16
to GWT Contributors
Thanks for your job!

I will take a look for sure in the next days!
Reply all
Reply to author
Forward
0 new messages