How validate a spring's bean property with annotation?
I have a Java server application using complex spring context.

I'd like to protect an editor of xml file with spring context definition from
mistakes.

I want that spring would validate beans with hibernate validator.

    public class Credentials {
    private String login, pass;

    @NotNull
    private URL url;

    public String getLogin() {
        return login;
    }

    public void setLogin(String login) {
        this.login = login;
    }

    public String getPass() {
        return pass;
    }

    public void setPass(String pass) {
        this.pass = pass;
    }

    public URL getUrl() {
        return url;
    }

    public void setUrl(URL url) {
        this.url = url;
    }
    }
How validate a spring's bean property with annotation?
===

I have a Java server application using complex spring context.

I'd like to protect an editor of xml file with spring context definition from
mistakes.

I want that spring would validate beans with hibernate validator.

    public class Credentials {
    private String login, pass;

    @NotNull
    private URL url;

    public String getLogin() {
        return login;
    }

    public void setLogin(String login) {
        this.login = login;
    }

    public String getPass() {
        return pass;
    }

    public void setPass(String pass) {
        this.pass = pass;
    }

    public URL getUrl() {
        return url;
    }

    public void setUrl(URL url) {
        this.url = url;
    }
    }