• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

struts date validator for yyyy-MM-dd HH:mm:ss

 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

In my valdiation.xml file, I have the following validation for a field that should be in this yyyy-MM-dd HH:mm:ss format.

<field property="myTimestamp" depends="required, date">
<arg0 key="myTimestamp" resource="false"/>
<arg1 key="yyyy-MM-dd HH:mm:ss" resource="false" />
<var>
<var-name>datePatternStrict</var-name>
<var-value>yyyy-MM-dd HH:mm:ss</var-value>
</var>
</field>

The straneg thing is when the value in the form field matches the specified format, it still gives the error "myTimestamp should be in yyyy-MM-dd HH:mm:ss" format.

When I change the form field value to just yyyy-MM-dd, strangely it passes the validation.

Any idea how to get yyyy-MM-dd HH:mm:ss validatin to work?

I use Struts 1.1.

Thanks.
[ May 07, 2008: Message edited by: Wilson Gordon ]
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Did you solve this problem ? I have stucked in this same place as you :/

Regards
Jan
 
I got this tall by not having enough crisco in my diet as a kid. This ad looks like it had plenty of shortening:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!