struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "s" <srrem...@excite.com>
Subject Re: Struts 2 losing timestamp in java.util.Date when validation failed
Date Fri, 08 Jun 2012 18:47:06 GMT
Tried with Struts 2.3.4 and still having the issue.

Look at "View Source" in the browsee and note down value of field student.createdTimestmp.
It will have both date & time.

Remove Name (make it blank) and click on Save button.

Error will be displayed "Student Name is required". Now again take a look at "View Source".

Field student.createdTimestmp will only have date and time will be MISSING.



-----Original Message-----
From: "J. Garcia" [jogaco.en@gmail.com]
Date: 06/08/2012 05:15 AM
To: "Struts Users Mailing List" <user@struts.apache.org>
Subject: Re: Struts 2 losing timestamp in java.util.Date when validation failed

With 2.3.3, it is working for me, in my own app.
When input is returned, I can still see the timestamp value in the form.
Haven't tried with your example.


On Thu, Jun 7, 2012 at 7:39 PM, s <srremail@excite.com> wrote:

> Yep..That's what I did....
>
> But the question is, why it retains time information, if there is no
> validation error...?
>
>
>
> -----Original Message-----
> From: "J. Garcia" [jogaco.en@gmail.com]
> Date: 06/07/2012 12:21 PM
> To: "Struts Users Mailing List" <user@struts.apache.org>
> Subject: Re: Struts 2 losing timestamp in java.util.Date when validation
> failed
>
> Try using date formatting like this:
>
> <s:textfield key="student.date" value='%{getText("{0,date,dd/MM/yyyy
> HH:mm:ss.SSS}",{student.date})}'/>
>
> J.
>
> On Wed, Jun 6, 2012 at 11:08 PM, s <srremail@excite.com> wrote:
>
> > Here's an JSPs, action class and struts.xml
> >
> > http://localhost:8080/Sample/student_edit.action       calls form/jsp
> > studentDetails.
> >
> > Erase name and submit form, this will result in validation being failed.
> >
> > This will erase timestamp from hidden field
> > <s:hidden name="student.createdTimestmp"/>
> >
> > If not validation error occurs, then it retains time.
> >
> >
> >
> > -----Original Message-----
> > From: "Dave Newton" [davelnewton@gmail.com]
> > Date: 06/06/2012 12:57 PM
> > To: "Struts Users Mailing List" <user@struts.apache.org>
> > Subject: Re: Struts 2 losing timestamp in java.util.Date when validation
> > failed
> >
> > On Wed, Jun 6, 2012 at 12:54 PM, s <srremail@excite.com> wrote:
> >
> > > I found following work around.
> > > Sorry can't attach source JSP, because of client restrictions.
> >
> >
> > Here's the trivial workaround:
> >
> > * Create a minimally-failing example containing essentially identical
> JSP.
> > * Post it.
> >
> > Whether or not your client wishes to admit it, it's unlikely any sort of
> IP
> > law would protect the usage of a hidden field and date render in an
> example
> > JSP.
> >
> > Dave
> >
> >
> > ---------------------------------------------------------------------
> > 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


Mime
View raw message