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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:27:55+00:00 2026-06-05T16:27:55+00:00

Plain and simple issue: I would like to annotate my method parameter with some

  • 0

Plain and simple issue:

  • I would like to annotate my method parameter with some sort of annotation that would fire regular spring validation mechanism (based on Validator interface)
  • I don’t want to include JSR303 dependency

Any ideas? I looked on @Validated but it seems that it was not created for this purpose.

Right now I do it like this:

public String req(@ModelAttribute SomeRequest request, BindingResult errors) {
        validator.validate(request, errors); // This can be avoided
        if (!errors.hasErrors()) {
            // Valid request
            return ...
        } else {
            // There were errors 
            return ...
        }
}
  • 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-05T16:28:00+00:00Added an answer on June 5, 2026 at 4:28 pm

    In that case you need to create custom annotation using @interface and then use that instead of standard @Valid annotation and at runtime identify it and validate your fields accordingly. Hope this helps you. Cheers.

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

Sidebar

Related Questions

I would really appreciate some help with the following issue: I have a gadget
Situation is simple: I post a plain HTML form with a textarea. Then, in
In my open-source plain C code I use this simple structure to read and
I need to upload a potentially huge plain-text file to a very simple wsgi-app
I have a simple three table reference. It looks plain enough. The associations there
In my asp.net webforms application I am using plain and simple forms authentication hooked
I am developing an iPhone app that would send emoticons from iPhone to server-side.
I currently have a perl script that imports HTML and converts it to plain
The Question I would like to know if there is a standard convention for
It seems that Indexhibit (www.indexhibit.org) is a sort of standard when it comes to

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.