Validate with java & Spring

Posted on by Kim

import javax.validation.constraints.NotNull;

public class Car {

    @NotNull
    private String name;
}
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;

@Service
@Validated
public class CarService {

    public save(@Valid Car car) {
        // TODO
    }
}

0 Responses to "Validate with java & Spring ":