I have the below line in the xxxxAction.properties file and it in the WEB-INF/classes folder in the sample package as the actual action class. But I am getting the standard error message rather than
the custom one.
invalid.fieldvalue.retirementDate=Invalid date format. Please use MM/dd/yyyy.
Thanks,
Prasanth
On 3/4/25 11:32 AM, Prasanth Pasala wrote:
I will try the xxxAction.properties file. So @ConversionErrorFieldValidator is not an annotation to replace the xxxAction-validation.xml where we can specify the different validations we need and
the corresponding messages?
Thanks,
Prasanth
On 3/4/25 9:44 AM, Lukasz Lenart wrote:
pon., 3 mar 2025 o 23:32 Prasanth<dbad...@pangburngroup.com> napisał(a):
Hi,
I have a custom message for conversion error as below. But the webpage is
showing this and the default struts message. How do I suppress the struts
default message? I am using Struts 6.7.0
@ConversionErrorFieldValidator(fieldName = "retirementDate", message =
"Invalid date format. Please use MM/dd/yyyy.", shortCircuit = true)
public Date getRetirementDate() {
return retirementDate;
}
* Invalid field value for field "retirementDate".
* Invalid date format. Please use MM/dd/yyyy.
Have you read this?
https://struts.apache.org/core-developers/type-conversion.html#type-conversion-error-handling
I would use @ConversionErrorFieldValidator in case there is no
built-in support for a given conversion, in other case adjusting
messages on XxxxAction.properties is all you need. See the example app
https://github.com/apache/struts-examples/tree/main/type-conversion
Cheers
Łukasz
---------------------------------------------------------------------
To unsubscribe, e-mail:user-unsubscr...@struts.apache.org
For additional commands, e-mail:user-h...@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org