java - spring MVC : form : radiobutton for Boolean property -


I just want to know how to use a boolean in a spring MVC form.

I try this code:

My JSP:

  & lt; Form: radiobutton path = "dateInterval" value = "false" cssClass = "radio" /> & Lt; Form: Radiobutan Path = "Date" Interval "Value =" True "cssClass =" radio "/>   

Property on pojo:

  Personal Boolean date difference = false;   

But my dateInterval property is always empty!

I have working on my form like this:

  & lt; form: radiobeton path = "some property" value = "true" /> Lt; Spring: Message code = "label.roundYes" /> gt; & lt; form: radiobout path = "some property" value = "wrong" /> Lt; Spring: Message code = "label.roundNo" />   

And some properties in my model look like this:

  Private Boolean SomeProperty = false;   

It works fine I have not tried to do it with 'boolean', maybe just try it with boolean and see if it helps .

Comments