struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Li Ying <liying.cn.2...@gmail.com>
Subject Re: struts2.1 validation problem! with "fileUploadStack"
Date Fri, 19 Nov 2010 13:55:42 GMT
Maybe you can add a property in your action which return the current
date. And reference this property in your validation configuration.

Or create a Static method in an Utility class, return return the
current date, And reference this property in your validation
configuration.

If both of these don't work, you have to implement your check by a
validate method in your action.


2010/11/19 Mead Lai <laiqinyi@gmail.com>:
> Thank you, Dave.
> Your explain is helpful for me to understand it.
>
> I want to validate the birthday in struts2 validation.xml,
> The range of date is between 1900-01-01 and current Date.
> How to get current date time in the struts2 validation.xml,?
> Thanks!
>
> <field name="birth">
> <field-validator type="date">
> <param name="min">1900-01-01</param>
> <param name="max">${current Date}</param>
> <message>your birthday  shall be ${min}---${max}</message>
> </field-validator>
> </field>
>
> Regards,
> Mead
>
>
> On Thu, Nov 18, 2010 at 8:04 PM, Dave Newton <davelnewton@gmail.com> wrote:
>
>> Dave
>

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


Mime
View raw message