hibernate - GWT requestfactory validate entities on external server -


im usign gwt 2.7.0 request factory. edit: im not using client side validations, server side validations (hibernate annotations)

the entity im trying edit called "article.java".

in normal scenario, edit article on client side articleeditor (extends editor). when article reaches server, validations excecuted. if validation goes wrong, client side receive "set < constraintviolation < ? > > oerrors " can use in editorframework show errors on form.

in particular case have 2 servers :

a = 1 using gwt edit valueproxy (pojos) (does not persist entity).

b = other has access database (hibernate), accesed via stateless ejb.

i made copy of article(do not contain hibernate annotation, simple pojo) called "persistentarticle.java" (contains hibernate annotation logic). bothe classes have same attributes , methods.

after article edited, reaches server side a, send object via ejb message server b. in b create instance of persistentarticle article class , try persist. if validation goes wrong generates javax.validation.constraintviolationexception.

the problema dont know how bind validationexception generated server b requestfavtory , editorframework in server , show errors in form. (in normal scenario done automatically requestfactory in server a)

back in clien side, receive validationexception in

public void onfailure(serverfailure oerror) method receiver of request , not in

method onconstraintviolation(set< constraintviolation< ? >> oerrors, ideal.

is possible im trying ? recommend ?

english not mother tongue; please excuse errors on part.

thaks in advanced.

requestfactory validate objects before calling service methods, , abort if there violations. if validation doesn't fit in scheme, can't take advantage of it.

your validation done within service method, errors have sent in return value if want handle them on client side. means moving them value proxies, , constraint violations on client side.


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -