<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=sbrannen" rel="nofollow">Sam Brannen</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-6437?redirect=false" rel="nofollow">SPR-6437</a></strong> and commented</p>
<p dir="auto">When using <code class="notranslate">@Valid</code> to drive automatic validation of a model object, it is currently not possible to modify the bound model object prior to validation.</p>
<p dir="auto">With the SimpleFormController hierarchy it was straightforward to override BaseCommandController's onBind() or onBindAndValidate() methods to achieve custom binding; however, with <code class="notranslate">@MVC</code> it is currently not possible. Neither the WebBindingInitializer API nor an <code class="notranslate">@InitBinder</code> method provides a mechanism to plug in custom binding.</p>
<p dir="auto">Note that this was not an issue prior to support for <code class="notranslate">@Valid</code>, since without <code class="notranslate">@Valid</code> developers were responsible for executing validation code within a handler method.</p>
<p dir="auto">One possible solution would be to add support for an <code class="notranslate">@PostBinding</code> method or <code class="notranslate">@PreValidation</code> method (or similar) which would be allowed to modify the model after binding but prior to executing the handler method.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0 RC2</p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398109039" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/12449" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/12449/hovercard" href="https://github.com/spring-projects/spring-framework/issues/12449">#12449</a> Support for interception of controller method invocation after binding has completed (<em><strong>"is duplicated by"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398092800" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/10091" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/10091/hovercard" href="https://github.com/spring-projects/spring-framework/issues/10091">#10091</a> Integrating validation into the <code class="notranslate">@MVC</code> request lifecycle</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398100127" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/11138" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/11138/hovercard" href="https://github.com/spring-projects/spring-framework/issues/11138">#11138</a> <code class="notranslate">@MVC</code> should provide a way to invoke custom code at preBind stage</li>
</ul>
<p dir="auto">6 votes, 6 watchers</p>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=plethora" rel="nofollow">Taras Tielkes</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-3581?redirect=false" rel="nofollow">SPR-3581</a></strong> and commented</p>
<p dir="auto">Section "6.3.2. Declaring a pointcut" states:</p>
<hr>
<p dir="auto">A pointcut can be declared inside an aspect, in which case it is visible only within that aspect. A pointcut can also be declared directly inside an aop:config  element, enabling the pointcut definition to be shared across several aspects and advisors.</p>
<hr>
<p dir="auto">In practice such "visibility" rules don't exist. The aop:config parser will happily register any found pointcut, and doesn't contain any visibility logic.<br>
Using &lt;pointcut&gt; elements with the same "id", but contained by different aop:aspect elements does not "make it visible only within that aspect". Instead, it makes the XML parser throw an exception at runtime (because of duplicate xsd:ID values).</p>
<p dir="auto">I don't think special visibility logic is needed: no same person will use the schema-based AOP style do declare 100s of pointcuts. Instead I suggest to simply correct the documentation.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.0.5, 2.1 M1, 2.1 M2</p>