==== USE OF ANNOTATION ON BEAN FIELD ====
@Phone
public String getPhone() {
return phone;
}
==== PHONE NUMBER VALIDATION CLASS ===
import javax.validation.Constraint;
import javax.validation.Payload;
import javax.validation.ReportAsSingleViolation;
import javax.validation.constraints.Pattern;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* Created by baraole on 27/05/2015.
*/
@Documented
@Constraint(validatedBy = {})
@Pattern(regexp = "\\+?[0-9()]+")
@ReportAsSingleViolation
@Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER})
@Retention(RUNTIME)
public @interface Phone {
String message() default "not a well-formed phone number";
Class<?>[] groups() default {};
Class<? extends Payload>[] payload() default {};
/**
* Defines several {@code @Phone} annotations on the same element.
*/
@Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER})
@Retention(RUNTIME)
@Documented
public @interface List {
Phone[] value();
}
}
Tuesday, June 2, 2015
AngularJS - Combating AngularJS executing controller twice
AngularJS docs - ngController
Note that you can also attach controllers to the DOM by declaring it in a route definition via the $route service. A common mistake is to declare the controller again using ng-controller in the template itself. This will cause the controller to be attached and executed twice.
http://stackoverflow.com/questions/15535336/combating-angularjs-executing-controller-twice
Note that you can also attach controllers to the DOM by declaring it in a route definition via the $route service. A common mistake is to declare the controller again using ng-controller in the template itself. This will cause the controller to be attached and executed twice.
http://stackoverflow.com/questions/15535336/combating-angularjs-executing-controller-twice
Monday, June 1, 2015
Saturday, May 30, 2015
Wednesday, May 27, 2015
SASS - Resources about Sass maven plugin
http://www.yegor256.com/2014/06/26/sass-in-java-webapp.html
http://mvnrepository.com/artifact/org.jasig.maven/sass-maven-plugin/1.1.1
<dependency>
<groupId>org.jasig.maven</groupId>
<artifactId>sass-maven-plugin</artifactId>
<version>1.1.1</version>
</dependency>
http://mvnrepository.com/artifact/org.jasig.maven/sass-maven-plugin/1.1.1
<dependency>
<groupId>org.jasig.maven</groupId>
<artifactId>sass-maven-plugin</artifactId>
<version>1.1.1</version>
</dependency>
Monday, May 25, 2015
Subscribe to:
Posts (Atom)