You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Serge Bornow <se...@architech-solutions.com> on 2008/02/04 03:48:53 UTC

Datetimepicker simple thing doesn't work java.text.ParseException: Unparseable date: ""

Hi All,

I:'ve been battling this for many hours.
I hope someone can help.
Using JDK 1.5, Struts 2.0.11


My property:
shoot_date of type Date
has get and set and on execute()
set's the default date to today's date
setShoot_Date(new Date);

on the form:
<s:datetimepicker name="shoot_date" displayFormat="MM/dd/yyyy" />
even without displayformat it doesn't work.

what happens is that i click the submit button that submits an action 
that executes a method that tries to read the shoot_date and it's null.

Hence the error in my log:

java.text.ParseException: Unparseable date: ""
        at java.text.DateFormat.parse(DateFormat.java:337)
        at 
org.apache.struts2.components.DateTimePicker.format(DateTimePicker.java:309)


Does anyone have a good working example?

Thank you very much,

Serge


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Datetimepicker simple thing doesn't work java.text.ParseException: Unparseable date: ""

Posted by Laurie Harper <la...@holoweb.net>.
Doesn't that need to be theme="ajax"?

Serge Bornow wrote:
> Hello Jeromy,
> 
> I do have :  <s:head theme="simple" />
> Also, i use Netbeans to generate respective get/set method so they are 
> JavaBean std compliant.
> 
> The issue for me unfortunately is getting the value back , it seems to 
> lose it.
> :(
> 
> Thanks for feedback though.
> 
> Serge
> 
> Jeromy Evans wrote:
>> Hi Serge,
>>
>> You'll find many emails in this forum relating to DatePicker 
>> problems.  Some of the solutions are here: 
>> http://cwiki.apache.org/S2WIKI/vault.html
>>
>> In this case though, is it possible you've forgotten the s:head tag at 
>> the top of the page?
>>
>> Serge Bornow wrote:
>>> Hi All,
>>>
>>> I:'ve been battling this for many hours.
>>> I hope someone can help.
>>> Using JDK 1.5, Struts 2.0.11
>>>
>>>
>>> My property:
>>> shoot_date of type Date
>>> has get and set and on execute()
>>> set's the default date to today's date
>>> setShoot_Date(new Date);
>>>
>>> on the form:
>>> <s:datetimepicker name="shoot_date" displayFormat="MM/dd/yyyy" />
>>> even without displayformat it doesn't work.
>>>
>>> what happens is that i click the submit button that submits an action 
>>> that executes a method that tries to read the shoot_date and it's null.
>>>
>>> Hence the error in my log:
>>>
>>> java.text.ParseException: Unparseable date: ""
>>>        at java.text.DateFormat.parse(DateFormat.java:337)
>>>        at 
>>> org.apache.struts2.components.DateTimePicker.format(DateTimePicker.java:309) 
>>>
>>>
>>>
>>> Does anyone have a good working example?
>>>
>>> Thank you very much,
>>>
>>> Serge
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Datetimepicker simple thing doesn't work java.text.ParseException: Unparseable date: ""

Posted by Jeromy Evans <je...@blueskyminds.com.au>.
Here is an example where I use it successfully:

<s:datetimepicker name="incomingAnswer" displayFormat="d MMMM yyyy"
                  dayWidth="wide" formatLength="full" type="date"
                  value="%{defaultAnswerDate}"
                  startDate="%{tomorrowAsRFC3339}"
                  required="true"/>

but in this specific case defaultAnswerDate, startDate and 
incomingAnswer are all String properties whose values are in RFC3339 
format ("yyyy-MM-dd").
This doesn't account for the blank error you're experiencing.  As Dave 
mentioned, the most likely case for that is a property name mismatch.

Serge Bornow wrote:
> Hello Jeromy,
>
> I do have :  <s:head theme="simple" />
> Also, i use Netbeans to generate respective get/set method so they are 
> JavaBean std compliant.
>
> The issue for me unfortunately is getting the value back , it seems to 
> lose it.
> :(
>
> Thanks for feedback though.
>
> Serge
>
> Jeromy Evans wrote:
>> Hi Serge,
>>
>> You'll find many emails in this forum relating to DatePicker 
>> problems.  Some of the solutions are here: 
>> http://cwiki.apache.org/S2WIKI/vault.html
>>
>> In this case though, is it possible you've forgotten the s:head tag 
>> at the top of the page?
>>
>> Serge Bornow wrote:
>>> Hi All,
>>>
>>> I:'ve been battling this for many hours.
>>> I hope someone can help.
>>> Using JDK 1.5, Struts 2.0.11
>>>
>>>
>>> My property:
>>> shoot_date of type Date
>>> has get and set and on execute()
>>> set's the default date to today's date
>>> setShoot_Date(new Date);
>>>
>>> on the form:
>>> <s:datetimepicker name="shoot_date" displayFormat="MM/dd/yyyy" />
>>> even without displayformat it doesn't work.
>>>
>>> what happens is that i click the submit button that submits an 
>>> action that executes a method that tries to read the shoot_date and 
>>> it's null.
>>>
>>> Hence the error in my log:
>>>
>>> java.text.ParseException: Unparseable date: ""
>>>        at java.text.DateFormat.parse(DateFormat.java:337)
>>>        at 
>>> org.apache.struts2.components.DateTimePicker.format(DateTimePicker.java:309) 
>>>
>>>
>>>
>>> Does anyone have a good working example?
>>>
>>> Thank you very much,
>>>
>>> Serge
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Datetimepicker simple thing doesn't work java.text.ParseException: Unparseable date: ""

Posted by Serge Bornow <se...@architech-solutions.com>.
Hello Jeromy,

I do have :  <s:head theme="simple" />
Also, i use Netbeans to generate respective get/set method so they are 
JavaBean std compliant.

The issue for me unfortunately is getting the value back , it seems to 
lose it.
:(

Thanks for feedback though.

Serge

Jeromy Evans wrote:
> Hi Serge,
>
> You'll find many emails in this forum relating to DatePicker 
> problems.  Some of the solutions are here: 
> http://cwiki.apache.org/S2WIKI/vault.html
>
> In this case though, is it possible you've forgotten the s:head tag at 
> the top of the page?
>
> Serge Bornow wrote:
>> Hi All,
>>
>> I:'ve been battling this for many hours.
>> I hope someone can help.
>> Using JDK 1.5, Struts 2.0.11
>>
>>
>> My property:
>> shoot_date of type Date
>> has get and set and on execute()
>> set's the default date to today's date
>> setShoot_Date(new Date);
>>
>> on the form:
>> <s:datetimepicker name="shoot_date" displayFormat="MM/dd/yyyy" />
>> even without displayformat it doesn't work.
>>
>> what happens is that i click the submit button that submits an action 
>> that executes a method that tries to read the shoot_date and it's null.
>>
>> Hence the error in my log:
>>
>> java.text.ParseException: Unparseable date: ""
>>        at java.text.DateFormat.parse(DateFormat.java:337)
>>        at 
>> org.apache.struts2.components.DateTimePicker.format(DateTimePicker.java:309) 
>>
>>
>>
>> Does anyone have a good working example?
>>
>> Thank you very much,
>>
>> Serge
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Datetimepicker simple thing doesn't work java.text.ParseException: Unparseable date: ""

Posted by Jeromy Evans <je...@blueskyminds.com.au>.
Hi Serge,

You'll find many emails in this forum relating to DatePicker problems.  
Some of the solutions are here: http://cwiki.apache.org/S2WIKI/vault.html

In this case though, is it possible you've forgotten the s:head tag at 
the top of the page?

Serge Bornow wrote:
> Hi All,
>
> I:'ve been battling this for many hours.
> I hope someone can help.
> Using JDK 1.5, Struts 2.0.11
>
>
> My property:
> shoot_date of type Date
> has get and set and on execute()
> set's the default date to today's date
> setShoot_Date(new Date);
>
> on the form:
> <s:datetimepicker name="shoot_date" displayFormat="MM/dd/yyyy" />
> even without displayformat it doesn't work.
>
> what happens is that i click the submit button that submits an action 
> that executes a method that tries to read the shoot_date and it's null.
>
> Hence the error in my log:
>
> java.text.ParseException: Unparseable date: ""
>        at java.text.DateFormat.parse(DateFormat.java:337)
>        at 
> org.apache.struts2.components.DateTimePicker.format(DateTimePicker.java:309) 
>
>
>
> Does anyone have a good working example?
>
> Thank you very much,
>
> Serge
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Datetimepicker simple thing doesn't work java.text.ParseException: Unparseable date: ""

Posted by Dave Newton <ne...@yahoo.com>.
I'm not sure what the JavaBean convention would be for a property with an
underscore.

Have you tried it as "shootDate" (with corresponding
getShootDate/setShootDate methods)?

Dave

--- Serge Bornow <se...@architech-solutions.com> wrote:
> My property:
> shoot_date of type Date
> has get and set and on execute()
> set's the default date to today's date
> setShoot_Date(new Date);
> 
> on the form:
> <s:datetimepicker name="shoot_date" displayFormat="MM/dd/yyyy" />
> even without displayformat it doesn't work.
> 
> what happens is that i click the submit button that submits an action 
> that executes a method that tries to read the shoot_date and it's null.
> 
> Hence the error in my log:
> 
> java.text.ParseException: Unparseable date: ""
>         at java.text.DateFormat.parse(DateFormat.java:337)
>         at 
>
org.apache.struts2.components.DateTimePicker.format(DateTimePicker.java:309)
> 
> 
> Does anyone have a good working example?
> 
> Thank you very much,
> 
> Serge
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org