领先一步
VMware 提供培训和认证来加速你的进步。
了解更多欢迎回到新一期的Spring 本周精选。
本周内容丰富,让我们开始吧!
@Controller
类处理方法中,确保 BindingResult
参数紧跟在模型或命令参数之后,像这样 <CODE>@RequestMapping(...) public String handleRequest( @ModelAttribute @Valid YourCustomPojo attempt, BindingResult result)</code>.
In this example, <CODE>handleRequest</Code> will validate the POJO (<CODE>YourCustomPojo</code>) - checking the POJO for JSR303-annotations and attempting to apply the constraints because the POJO is annotated with <CODE>@Valid</CODE> - and stash any errors in the <CODE>BindingResult</code>, which it makes available if we ask for it.
@SpelAssert
,它的工作方式类似于 JSR303 的 @ScriptAssert
。</LI>
<LI> The <EM>Java J2EE SOA Key Points</EM> blog has a nice post on
<A href="http://stlarch.blogspot.com/2013/03/spring-ws-jaxb-web-sevice-client.html">using the Spring WS JAXB web service client</a>. There's very little narrative, but lots of code.
</LI>