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 8175517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:48:42+00:00 2026-06-06T22:48:42+00:00

We use @Constraint.Required to validate the fields of our forms, and this generates a

  • 0

We use @Constraint.Required to validate the fields of our forms, and this generates a ValidationError – which is all well and nice. This error has a standard error message (error.required) which is associated with the following string: “This field is required”.

However, we want to have control over this string and (possibly) override it – how can we do this? We have a message file in our conf/-folder which has the following line:

error.required = dummytext

But the error message still reads “this field is required” – even though the messages-file is being read (we did some tests).

How can we override these messages?

Thanks!

  • 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-06T22:48:43+00:00Added an answer on June 6, 2026 at 10:48 pm

    That’s not quite good solution especially when you want to make multilingual app. So placing changed messages in annotations will fail in such case.

    Fortunately there is solution, which works as expected. You need to place your labels into the language file with language code as an extension ie. conf/messages.en, even if there is only one language defined and it’s English.

    The default messages with their keys can be copied from the Play’s sources

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

Sidebar

Related Questions

I'm trying to use HTML5 Constraint Validation in my forms to help users spot
I have a validation class which I would like to use to check all
We manage several ASP.NET MVC client web sites, which all use a data annotation
I want to use Peter Marklund's html test plugin to automatically validate all of
I'm using SQL Server and I want to use identity constraint in it I
What is the best constraint to use on a forum table where users leave
In SQL Server 2005+ (I use both), does adding the UNIQUE constraint to a
Django tutorials everywhere use constant-set application name all around - in urls file, in
My colleague mentioned that our client DBA proposed the removal of all foreign key
I am getting a ERROR: duplicate key value violates unique constraint users_pkey Detail: Key

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.