JSF&中的日期验证丰富的面孔 [英] Date Validation in JSF & Richfaces

查看:38
本文介绍了JSF&中的日期验证丰富的面孔的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用rich:calendar在我的应用程序中显示日期 但是,在某些情况下,日期验证无法正常工作. 即有人输入日期为05/05/2010sfc,在这种情况下,它会自动修剪最后的多余字符 并在下一页上正确显示日期,而不是在同一页上显示无效日期的错误.

I m using a rich:calendar to display Date in my application But some how date validation isn't working properly in a particular scenario. i.e it some one enters date as 05/05/2010sfc in this case it automatically trims the extra characters in the end and displays date properly in next page instead of giving an error of invalid date on same page.

在其他情况下也可以使用,例如asd05/05/2010、05sfa/05/2010等

It works in other cases such as asd05/05/2010, 05sfa/05/2010, etc

我尝试使用,但没有帮助

I tried using but it didn't help

有人可以帮我吗...

Can anyone please help me on this...

推荐答案

最好的办法是将输入字段的最大长度限制为10或提供自定义日期验证器.

Best what you can do is to restrict the input field max length to 10 or supply a custom date validator.

这篇关于JSF&中的日期验证丰富的面孔的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆