You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ambaris Mohanty <am...@lifestylestores.com> on 2007/06/02 13:40:42 UTC

dd-MON-yyyy date format validation

Hi all,

I'm developing a jsp form that has a date field. I want to get the date in
dd-MON-yyyy from the user. I can't validate the format using struts
validation framework. Can any one help me on this?

Thank you,

Ambaris Mohanty


Re: dd-MON-yyyy date format validation

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ambaris,

Ambaris Mohanty wrote:
> I'm developing a jsp form that has a date field. I want to get the date in
> dd-MON-yyyy from the user. I can't validate the format using struts
> validation framework.

Why not?

http://struts.apache.org/1.3.8/faqs/validator.html [See "Standard Built
In Validations" section]

If you are using Struts 2, then you should say so.

If Struts 2's date validator does not allow the user to specify the date
format, then a significant loss of functionality has occurred. :(

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGYbGc9CaO5/Lv0PARAqmaAJwKkz0qlDRgnc926wDtpVvkjCJOxQCeMz5f
x2ErqsjxBGFGHfIN/hrocTk=
=ONzX
-----END PGP SIGNATURE-----

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


Re: dd-MON-yyyy date format validation

Posted by Jeremiah Johnson <jo...@egr.msu.edu>.
You will have to write your own custom validator or implement the 
validate() method on the form. Custom validator:

http://www.onjava.com/pub/a/onjava/2002/12/11/jakartastruts.html?page=last



Ambaris Mohanty wrote:
> Hi all,
>
> I'm developing a jsp form that has a date field. I want to get the date in
> dd-MON-yyyy from the user. I can't validate the format using struts
> validation framework. Can any one help me on this?
>
> Thank you,
>
> Ambaris Mohanty
>
>
>   


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