Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>As for the empty string, I suppose the problem is that your <strong>0</strong> is casted to <em>Integer</em>, not <em>Double</em> so you have to use postfix <em>d</em> : <strong>0.0d</strong>;</p> <p>As for NumberFormatException, I don't see any problem that converter could not convert it. If you want to have a custom message for convertion errors you should put that message to your message properties file following the semantics of <a href="http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/validation/DefaultMessageCodesResolver.html" rel="nofollow">DefaultMessageCodeResolver</a> I think it will be something like <code>typeMismatch.java.lang.Double = "invalid floating point number"</code> and have a message source in your bean configuration </p> <pre><code> &lt;bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"&gt; &lt;property name="basenames"&gt; &lt;list&gt; &lt;value&gt;exceptions&lt;/value&gt;&lt;!--- that means you have exceptions.properties in your class path with the typeMismatch string specified above--&gt; &lt;/list&gt; &lt;/property&gt; &lt;/bean&gt; </code></pre> <p>Also the concept of Property Editors is outdated now, the <a href="http://docs.spring.io/spring/docs/3.2.x/spring-framework-reference/html/validation.html#core-convert" rel="nofollow">new API with converters</a> is the way to go, because spring does not create a heap of helper objects(property editors) for any property being edited with this approach.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload