title: Bean validator: validate nested object while adding a prefix to its error messages
body: <p>I'm having a problem where, when I have multiple nested beans of the same type, the returned message may end up being the same, which can confuse the user:</p>
  <p>Minimal example (the real beans have lots of fields):</p>
  <pre class="lang-java prettyprint-override"><code>class A {
      @NotBlank(&quot;Name is obligatory.&quot;)
      String name;
      
      @NotBlank(&quot;Address is obligatory.&quot;)
      String name;
  }
  
  class B {
      @Valid
      A origin;
  
      @Valid
      A destination;
  }
  </code></pre>
  <p>If I run <code>B</code> against the validator with blank names, it will always return &quot;Name is obligatory.&quot;, no matter if it comes from the <code>origin</code> or from the <code>destination</code>. I know that the error message comes with the field names, but that information, by itself, is not very useful for the end user.</p>
  <p>Is there some annotation that validates the nested beans similarly to what <code>@Valid</code> does, but adding a prefix, so that instead of saying &quot;Name is obligatory.&quot;, it would say either &quot;Original person: Name is obligatory.&quot; or &quot;Destination person: Name is obligatory.&quot;?</p>