playframework 2.1 - Execution Exception with @inputDate when call form.get() method -


i have input of date type. attribute this:

@formats.datetime(pattern="dd/mm/yyyy") public date prazo; 

in *.scala.html file, tried this:

@helper.input(pedidoform("prazo"), '_label -> "prazo", '_help -> "") { (id, name, value, args) =>      <input type="date" name="@name" id="@id" maxlength="14" @tohtmlargs(args)> } 

and

@inputdate(pedidoform("prazo"), '_label -> "prazo", '_help -> "") 

it compiles , seems work fine, in controller have like:

form<pedido> pedidoform = form(pedido.class).bindfromrequest(); ... pedidoform.get(); // throws execution exception 

does have idea of can happening??

thanks attention.

i think have entered wrong format date input.

form have tried. if entered 22/03/1989 value of input, there no runtime exception. if entered 22 03 1989, exception occurred. think because define prazo field dd/mm/yyyy date format.

so let's again. if define prazo field dd mm yyyy date format, , entered value 22 03 1989 value of input, there no runtime exception. in addition, there interested me, if entered 22/03/1989 there no runtime exception too. but, date entered previously, it cannot parsed correctly.

in stage, think framework accept value dd/mm/yyyy date object. if want other date format displayed or entered @formats.datetime(pattern="dd mm yyyy") annotation should be used.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -