Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8611977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:30:49+00:00 2026-06-12T04:30:49+00:00

In my struts2 application I have field named carrierNo that accepts integer, when i

  • 0

In my struts2 application I have field named carrierNo that accepts integer, when i put string in it gives me this validation error message:

    *Invalid field value for field "carrierNo".*

i can customize this error message in the properties file like this

    invalid.fieldvalue.carrierNo=this field does not accept characters

but i don’t want to write a customized message for every non String field in my web application, i want to make it general, i tried the following but it did not work

  invalid.fieldvalue.%{getText(fieldName)}=this field does not accept characters

if there is no way to make general, please help me disable this message at all.
then i will use converstion field validator with single message that i define in the properties file.

so my request is to help me make this invalid.fieldvalue.carrierNo general something like this form invalid.fieldvalue.%{getText(fieldName)}

or disable the display of this error message Invalid field value for field “carrierNo”.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T04:30:50+00:00Added an answer on June 12, 2026 at 4:30 am

    You could create your own implementation of ConversionErrorInterceptor which finds out the class of failed field and gets your custom message.

    Edit:
    See source code for ConversionErrorInterceptor. For example you could do something like this in your custom interceptor inside intercept method

    // get field by name from action
    Field f = invocation.getAction().getClass().getDeclaredField(propertyName);
    // get type of field
    Class clz = f.getType();
    
    String message = LocalizedTextUtil.findDefaultText(XWorkMessages.DEFAULT_INVALID_FIELDVALUE + "." + clz,
                        invocationContext.getLocale());
    

    And in your messages.properties file put xwork.default.invalid.fieldvalue.int, xwork.default.invalid.fieldvalue.float, etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a struts2 web application which accepts both POST and GET requests in
I have struts2 application with struts2 version 2.0, There is no error on server
We have an running application that is developed in struts-2.0.14 . In this we
In a certain Java class for a Struts2 web application, I have this line
I am working on a struts2 application. I have an auto generated field in
I am using Struts2 for a web application development. i have this particular problem
My common usecase for my Struts2 application is that I have Actions that collect
I have a struts2 application with a single page that may show one of
I have a problem with a Struts2 + dojo web application that I've inherited.
I have a web application developed with Struts2, JSP, JPA, Spring and MySql. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.