You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by xianwinwin <xi...@gmail.com> on 2008/03/27 00:34:48 UTC

@ExpressionValidator - how to set the expression correctly ? (amount either greater than 0 or null? )

Hi,

I have the following Expression Validator:

@ExpressionValidator(expression = "amount > 0", message = "err message")

what should come in the expression if amount can be either greater than 0 or
null? 

thank you!
-- 
View this message in context: http://www.nabble.com/%40ExpressionValidator---how-to-set-the-expression-correctly---%28amount-either-greater-than-0-or-null--%29-tp16319035p16319035.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: @ExpressionValidator - how to set the expression correctly ? (amount either greater than 0 or null? )

Posted by xianwinwin <xi...@gmail.com>.
thanks, this throws an exception 

FreeMarker template error!

Method public java.util.List
org.apache.struts2.components.Form.getValidators(java.lang.String) threw an
exception when invoked on org.apache.struts2.components.Form@e75a11
The problematic instruction:





Randy Burgess-3 wrote:
> 
> Did you try 
> @ExpressionValidator(expression = "(amount > 0) || (amount == null)",
> message = "err message")
> 
> Regards,
> Randy Burgess
> Sr. Web Applications Developer
> Nuvox Communications
> 
> 
> 
>> From: xianwinwin <xi...@gmail.com>
>> Reply-To: Struts Users Mailing List <us...@struts.apache.org>
>> Date: Wed, 26 Mar 2008 16:34:48 -0700 (PDT)
>> To: <us...@struts.apache.org>
>> Subject: @ExpressionValidator - how to set the expression correctly ?
>> (amount
>> either greater than 0 or null? )
>> 
>> 
>> Hi,
>> 
>> I have the following Expression Validator:
>> 
>> @ExpressionValidator(expression = "amount > 0", message = "err message")
>> 
>> what should come in the expression if amount can be either greater than 0
>> or
>> null? 
>> 
>> thank you!
>> -- 
>> View this message in context:
>> http://www.nabble.com/%40ExpressionValidator---how-to-set-the-expression-corre
>> ctly---%28amount-either-greater-than-0-or-null--%29-tp16319035p16319035.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>> 
> 
> 
> 
> This email and any attachments ("Message") may contain legally privileged
> and/or confidential information.  If you are not the addressee, or if this
> Message has been addressed to you in error, you are not authorized to
> read, copy, or distribute it, and we ask that you please delete it
> (including all copies) and notify the sender by return email.  Delivery of
> this Message to any person other than the intended recipient(s) shall not
> be deemed a waiver of confidentiality and/or a privilege.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/%40ExpressionValidator---how-to-set-the-expression-correctly---%28amount-either-greater-than-0-or-null--%29-tp16319035p16334964.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: @ExpressionValidator - how to set the expression correctly ? (amount either greater than 0 or null? )

Posted by xianwinwin <xi...@gmail.com>.
WAIT!!!!!

you were right!!! i was too quick - this solved it. THANK YOU!!!!



Randy Burgess-3 wrote:
> 
> Did you try 
> @ExpressionValidator(expression = "(amount > 0) || (amount == null)",
> message = "err message")
> 
> Regards,
> Randy Burgess
> Sr. Web Applications Developer
> Nuvox Communications
> 
> 
> 
>> From: xianwinwin <xi...@gmail.com>
>> Reply-To: Struts Users Mailing List <us...@struts.apache.org>
>> Date: Wed, 26 Mar 2008 16:34:48 -0700 (PDT)
>> To: <us...@struts.apache.org>
>> Subject: @ExpressionValidator - how to set the expression correctly ?
>> (amount
>> either greater than 0 or null? )
>> 
>> 
>> Hi,
>> 
>> I have the following Expression Validator:
>> 
>> @ExpressionValidator(expression = "amount > 0", message = "err message")
>> 
>> what should come in the expression if amount can be either greater than 0
>> or
>> null? 
>> 
>> thank you!
>> -- 
>> View this message in context:
>> http://www.nabble.com/%40ExpressionValidator---how-to-set-the-expression-corre
>> ctly---%28amount-either-greater-than-0-or-null--%29-tp16319035p16319035.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>> 
> 
> 
> 
> This email and any attachments ("Message") may contain legally privileged
> and/or confidential information.  If you are not the addressee, or if this
> Message has been addressed to you in error, you are not authorized to
> read, copy, or distribute it, and we ask that you please delete it
> (including all copies) and notify the sender by return email.  Delivery of
> this Message to any person other than the intended recipient(s) shall not
> be deemed a waiver of confidentiality and/or a privilege.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/%40ExpressionValidator---how-to-set-the-expression-correctly---%28amount-either-greater-than-0-or-null--%29-tp16319035p16335427.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: @ExpressionValidator - how to set the expression correctly ? (amount either greater than 0 or null? )

Posted by Randy Burgess <RB...@nuvox.com>.
Did you try 
@ExpressionValidator(expression = "(amount > 0) || (amount == null)",
message = "err message")

Regards,
Randy Burgess
Sr. Web Applications Developer
Nuvox Communications



> From: xianwinwin <xi...@gmail.com>
> Reply-To: Struts Users Mailing List <us...@struts.apache.org>
> Date: Wed, 26 Mar 2008 16:34:48 -0700 (PDT)
> To: <us...@struts.apache.org>
> Subject: @ExpressionValidator - how to set the expression correctly ? (amount
> either greater than 0 or null? )
> 
> 
> Hi,
> 
> I have the following Expression Validator:
> 
> @ExpressionValidator(expression = "amount > 0", message = "err message")
> 
> what should come in the expression if amount can be either greater than 0 or
> null? 
> 
> thank you!
> -- 
> View this message in context:
> http://www.nabble.com/%40ExpressionValidator---how-to-set-the-expression-corre
> ctly---%28amount-either-greater-than-0-or-null--%29-tp16319035p16319035.html
> Sent from the Struts - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 



This email and any attachments ("Message") may contain legally privileged and/or confidential information.  If you are not the addressee, or if this Message has been addressed to you in error, you are not authorized to read, copy, or distribute it, and we ask that you please delete it (including all copies) and notify the sender by return email.  Delivery of this Message to any person other than the intended recipient(s) shall not be deemed a waiver of confidentiality and/or a privilege.

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