PlayWithMagic / PlayWithMagic.org

PlayWithMagic.org is a web application that catalogs magic tricks and helps magicians build shows.
http://playwithmagic.github.io/PlayWithMagic.org/
Apache License 2.0
2 stars 1 forks source link

Refactor page validation to use @ validation #114

Closed marknelsonengineer closed 9 years ago

marknelsonengineer commented 9 years ago

Utilize the Play Framework to do much of the field validation for us. In the form backing class, use this pattern:

    @Required(message = "Please write a brief description of your routine.")
    @MaxLength(value = 45, message = "Description can't be more than 45 characters.")
    public String description;

...to do validation.

Check this out: https://www.playframework.com/documentation/1.2.x/validation-builtin

Even though this is documented in an older version of Play, it's still in 2.x, though undocumented.