June 2014
Beginner to intermediate
304 pages
7h 25m
English
In this section, you will learn how to create custom validation annotations and use them. Add a custom product ID validation to your add product page to validate duplicate product IDs by performing the following steps:
ProductId (ProductId.java) under the package com.packt.webstore.validator in the source folder src/main/java. Then, add the following code snippet in it:package com.packt.webstore.validator; import static java.lang.annotation.ElementType.ANNOTATION_TYPE; import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.RetentionPolicy.RUNTIME; import java.lang.annotation.Documented; ...