Verification in the GWT + GAE application

Is there a standard approach to checking input and displaying errors in the GWT + GAE application?

The Eclipse plugin generates a GWT project with the shared.FieldVerifier class, which provides a static method for checking values:

public static boolean isValidName(String name) {
    if (name == null) {
        return false;
    }
    return name.length() > 3;
}

isValidName () is then called on the input in the client code and on the server side, and if something is wrong, the error logic is executed. By the way, this approach (a set of static verification methods, a specific error in displaying logic in each case) may not be very scalable.

Also, I found the gwt-validation project on code.google.com , but I haven't researched it yet.

Could you recommend any standard approaches / libraries that will help you deal with checking and displaying errors? Is gwt validation library the standard?

+3
source share
1 answer

The standard is JSR303 and can be used for client-side verification also on the server side.

Please take a look at this topic: GWT JSR 303 Certificate Validation

+2
source

Source: https://habr.com/ru/post/1778364/


All Articles