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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:45:23+00:00 2026-06-17T15:45:23+00:00

Within Spring MVC, is there way to identify the ‘level’ or ‘type’ of error?

  • 0

Within Spring MVC, is there way to identify the ‘level’ or ‘type’ of error? Examples include information, warning, and error messages?

Btw, this is purely for formatting purposes. For example, error messages tend to be in red text while warning messages are simply black.

** Updating for clarity:

In our current system, we have multiple levels of messages: error, warning, info. Is there anything built into SpringMVC, that allows me to set an error message’s level?

Also, it appears that we’re using BindingResults in the Controllers (specifically BeanPropertyBindingResults), and triggering a Validator (our custom class that implements Spring’s Validator interface).

During validation we end up writing something like:

ValidationUtils.rejectIfEmptyOrWhitespace(errors, modelVariable, "required", new Object[] {variableDisplayName});

Or

errors.rejectValue("field", "fieldName");
  • 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-17T15:45:25+00:00Added an answer on June 17, 2026 at 3:45 pm

    In the end, we ended up extending ObjectError and FieldError to include a new field, ‘ErrorLevel’. When creating a new error -we use these new objects so that we can set the ErrorLevel. On the JSP, we look for the ErrorLevel to determine how to display the messages.

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

Sidebar

Related Questions

Is there a way to stream a file using ASP.NET MVC FileContentResult within the
Is there a way within asp.net MVC 2 whereby I can route a request
Using Spring MVC, is there any way to factorize the org.springframework.ui.Model , in order
I am trying to make an asynchronous call from within my (Spring MVC based)
I am using Spring MVC within Tomcat and what I thought was a standard
I'm trying to add a URL parameter within a Spring MVC application. It's a
I'm trying to figure out the best way to validate data within a MVC
I'm using Spring's SchedulerFactoryBean to run some Quartz jobs within a Spring based java
I am attempting to implement thread-safe usage of ConcurentHashMap within singleton spring service that
I have a spring bean that I get like this within a method- repAppCaller

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.