<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Integrating Spring MVC 3.0 with JSR 303 (aka javax.validation.*)</title>
	<atom:link href="http://www.openscope.net/2010/02/08/spring-mvc-3-0-and-jsr-303-aka-javax-validation/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.openscope.net/2010/02/08/spring-mvc-3-0-and-jsr-303-aka-javax-validation/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=spring-mvc-3-0-and-jsr-303-aka-javax-validation</link>
	<description>Life with Jboss</description>
	<lastBuildDate>Mon, 26 Jul 2010 03:52:10 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Ant</title>
		<link>http://www.openscope.net/2010/02/08/spring-mvc-3-0-and-jsr-303-aka-javax-validation/comment-page-1/#comment-361</link>
		<dc:creator>Ant</dc:creator>
		<pubDate>Mon, 26 Jul 2010 03:52:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.openscope.net/?p=602#comment-361</guid>
		<description>Thanks for the workaround, I&#039;ll point to your workaround in the article.</description>
		<content:encoded><![CDATA[<p>Thanks for the workaround, I&#8217;ll point to your workaround in the article.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ant</title>
		<link>http://www.openscope.net/2010/02/08/spring-mvc-3-0-and-jsr-303-aka-javax-validation/comment-page-1/#comment-348</link>
		<dc:creator>Ant</dc:creator>
		<pubDate>Fri, 23 Jul 2010 15:17:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.openscope.net/?p=602#comment-348</guid>
		<description>Can you post your class definition for Patient? It sounds like whatever validation annotations you&#039;re using are not being parsed in or loaded up.  Try doing a single annotation first and step through your code to make sure the BindingResult result variable has errors - if it does then your jsp isn&#039;t displaying correctly (try adding  @ModelAttribute(&quot;patient&quot;) before @Valid to provide scope ) and if it doesn&#039;t then double check your annotations to make sure they&#039;re set up correctly.</description>
		<content:encoded><![CDATA[<p>Can you post your class definition for Patient? It sounds like whatever validation annotations you&#8217;re using are not being parsed in or loaded up.  Try doing a single annotation first and step through your code to make sure the BindingResult result variable has errors &#8211; if it does then your jsp isn&#8217;t displaying correctly (try adding  @ModelAttribute(&#8220;patient&#8221;) before @Valid to provide scope ) and if it doesn&#8217;t then double check your annotations to make sure they&#8217;re set up correctly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stefan Haberl</title>
		<link>http://www.openscope.net/2010/02/08/spring-mvc-3-0-and-jsr-303-aka-javax-validation/comment-page-1/#comment-347</link>
		<dc:creator>Stefan Haberl</dc:creator>
		<pubDate>Fri, 23 Jul 2010 11:55:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.openscope.net/?p=602#comment-347</guid>
		<description>Hi,

For those of you who want to integrate Hibernate Validator with Spring and want to generate a custom message:

A workaround I&#039;m quite happy with is to wire your Spring MessageSource into your custom Validator like so:   

@Autowired
private MessageSource messageSource;

and then manually resolve the error message:

      Locale locale = LocaleContextHolder.getLocale();
      String message = messageSource.getMessage(&quot;key&quot;, new Object[] { &quot;Test&quot; },
          locale);

      context.disableDefaultConstraintViolation();
  
context.buildConstraintViolationWithTemplate(message).addConstraintViolation();

HTH</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>For those of you who want to integrate Hibernate Validator with Spring and want to generate a custom message:</p>
<p>A workaround I&#8217;m quite happy with is to wire your Spring MessageSource into your custom Validator like so:   </p>
<p>@Autowired<br />
private MessageSource messageSource;</p>
<p>and then manually resolve the error message:</p>
<p>      Locale locale = LocaleContextHolder.getLocale();<br />
      String message = messageSource.getMessage(&#8220;key&#8221;, new Object[] { &#8220;Test&#8221; },<br />
          locale);</p>
<p>      context.disableDefaultConstraintViolation();</p>
<p>context.buildConstraintViolationWithTemplate(message).addConstraintViolation();</p>
<p>HTH</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julien</title>
		<link>http://www.openscope.net/2010/02/08/spring-mvc-3-0-and-jsr-303-aka-javax-validation/comment-page-1/#comment-341</link>
		<dc:creator>Julien</dc:creator>
		<pubDate>Wed, 21 Jul 2010 20:02:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.openscope.net/?p=602#comment-341</guid>
		<description>Sorry, I didn&#039;t explain well my problem. First I&#039;m in a portlet environment. For detecting hibernate validator, I wrote this in my context : 

And for my method I&#039;m doing this :

protected void registration(@Valid Patient patient,
			BindingResult result) {		
	if (result.hasErrors()) {
		return;
	}
}

But my result never has errors, even if my form is empty. I think that I missed something.</description>
		<content:encoded><![CDATA[<p>Sorry, I didn&#8217;t explain well my problem. First I&#8217;m in a portlet environment. For detecting hibernate validator, I wrote this in my context : </p>
<p>And for my method I&#8217;m doing this :</p>
<p>protected void registration(@Valid Patient patient,<br />
			BindingResult result) {<br />
	if (result.hasErrors()) {<br />
		return;<br />
	}<br />
}</p>
<p>But my result never has errors, even if my form is empty. I think that I missed something.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ant</title>
		<link>http://www.openscope.net/2010/02/08/spring-mvc-3-0-and-jsr-303-aka-javax-validation/comment-page-1/#comment-338</link>
		<dc:creator>Ant</dc:creator>
		<pubDate>Wed, 21 Jul 2010 14:24:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.openscope.net/?p=602#comment-338</guid>
		<description>Thanks for the heads up!</description>
		<content:encoded><![CDATA[<p>Thanks for the heads up!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stuart Gunter</title>
		<link>http://www.openscope.net/2010/02/08/spring-mvc-3-0-and-jsr-303-aka-javax-validation/comment-page-1/#comment-336</link>
		<dc:creator>Stuart Gunter</dc:creator>
		<pubDate>Wed, 21 Jul 2010 12:23:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.openscope.net/?p=602#comment-336</guid>
		<description>As a response to the comments about group validation. I&#039;m not sure if anyone has mentioned it already, but Spring Web Flow does handle subset validation for scenarios where you want to validate parts of the object at various stages (e.g. in a wizard).

Have a look here for more details: http://static.springsource.org/spring-webflow/docs/2.1.x/reference/html/ch05s10.html</description>
		<content:encoded><![CDATA[<p>As a response to the comments about group validation. I&#8217;m not sure if anyone has mentioned it already, but Spring Web Flow does handle subset validation for scenarios where you want to validate parts of the object at various stages (e.g. in a wizard).</p>
<p>Have a look here for more details: <a href="http://static.springsource.org/spring-webflow/docs/2.1.x/reference/html/ch05s10.html" rel="nofollow">http://static.springsource.org/spring-webflow/docs/2.1.x/reference/html/ch05s10.html</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
