You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by s <sr...@excite.com> on 2012/06/06 18:18:12 UTC

Struts 2 losing timestamp in java.util.Date when validation failed

I have a form with java.util.Date (createTimestmp) and it has both date & time.
createTimestmp is an hidden field on the form. When I fetch record from database it has "5/17/12 12:58:33 PM.688" as value.

If I change something on the form and if validation is GOOD, then creatTimestmp value is retained to the original value. That is, its still "5/17/12 12:58:33 PM.688".

But if the validation fails, and user goes to input form again, then createTimestmp value changes to "5/17/12". The timestamp is missing.

Looks like a bug to me in struts 2.

Why is struts 2 dropping timestamp on INPUT result...?

Can someone please help.

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


Re: Struts 2 losing timestamp in java.util.Date when validation failed

Posted by Dave Newton <da...@gmail.com>.
And the JSP?

On Wed, Jun 6, 2012 at 12:18 PM, s <sr...@excite.com> wrote:

>
> I have a form with java.util.Date (createTimestmp) and it has both date &
> time.
> createTimestmp is an hidden field on the form. When I fetch record from
> database it has "5/17/12 12:58:33 PM.688" as value.
>
> If I change something on the form and if validation is GOOD, then
> creatTimestmp value is retained to the original value. That is, its still
> "5/17/12 12:58:33 PM.688".
>
> But if the validation fails, and user goes to input form again, then
> createTimestmp value changes to "5/17/12". The timestamp is missing.
>
> Looks like a bug to me in struts 2.
>
> Why is struts 2 dropping timestamp on INPUT result...?
>
> Can someone please help.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>

Re: Struts 2 losing timestamp in java.util.Date when validation failed

Posted by Dave Newton <da...@gmail.com>.
And the JSP?

On Wed, Jun 6, 2012 at 12:18 PM, s <sr...@excite.com> wrote:

>
> I have a form with java.util.Date (createTimestmp) and it has both date &
> time.
> createTimestmp is an hidden field on the form. When I fetch record from
> database it has "5/17/12 12:58:33 PM.688" as value.
>
> If I change something on the form and if validation is GOOD, then
> creatTimestmp value is retained to the original value. That is, its still
> "5/17/12 12:58:33 PM.688".
>
> But if the validation fails, and user goes to input form again, then
> createTimestmp value changes to "5/17/12". The timestamp is missing.
>
> Looks like a bug to me in struts 2.
>
> Why is struts 2 dropping timestamp on INPUT result...?
>
> Can someone please help.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>

Re: Struts 2 losing timestamp in java.util.Date when validation failed

Posted by Martin Cooper <ma...@apache.org>.
On Wed, Jun 6, 2012 at 9:18 AM, s <sr...@excite.com> wrote:
>
> I have a form with java.util.Date (createTimestmp) and it has both date & time.
> createTimestmp is an hidden field on the form. When I fetch record from database it has "5/17/12 12:58:33 PM.688" as value.

This is a question about using Struts, and should therefore be
directed to the User list. The Dev list is for discussion of the
development of the Struts framework itself.

--
Martin Cooper


> If I change something on the form and if validation is GOOD, then creatTimestmp value is retained to the original value. That is, its still "5/17/12 12:58:33 PM.688".
>
> But if the validation fails, and user goes to input form again, then createTimestmp value changes to "5/17/12". The timestamp is missing.
>
> Looks like a bug to me in struts 2.
>
> Why is struts 2 dropping timestamp on INPUT result...?
>
> Can someone please help.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>

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